Files
kiri-databases/Condition/NotInCondition.php
T

30 lines
605 B
PHP
Raw Normal View History

2022-01-09 03:49:51 +08:00
<?php
declare(strict_types=1);
namespace Database\Condition;
use JetBrains\PhpStorm\Pure;
/**
* Class NotInCondition
* @package Database\Condition
*/
class NotInCondition extends Condition
{
2023-12-12 15:35:35 +08:00
/**
* @return string|null
* @throws
*/
#[Pure] public function builder(): ?string
{
if (!is_array($this->value)) {
throw new \Exception('Builder data by a empty string. need array');
}
$value = '\'' . implode('\',\'', $this->value) . '\'';
return '`' . $this->column . '` not in(' . $value . ')';
}
2022-01-09 03:49:51 +08:00
}