Files

30 lines
597 B
PHP
Raw Permalink 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
*/
2025-12-16 20:20:08 +08:00
public function builder(): ?string
2023-12-12 15:35:35 +08:00
{
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
}