Files
kiri-core/Database/Condition/NotLikeCondition.php
T

30 lines
481 B
PHP
Raw Normal View History

2020-08-31 12:38:32 +08:00
<?php
2020-10-29 18:17:25 +08:00
declare(strict_types=1);
2020-08-31 12:38:32 +08:00
namespace Database\Condition;
use Snowflake\Core\Str;
/**
* Class NotLikeCondition
* @package Database\Condition
*/
class NotLikeCondition extends Condition
{
2020-10-29 18:17:25 +08:00
public string $pos = '';
2020-08-31 12:38:32 +08:00
/**
* @return string
*/
public function builder()
{
if (!is_string($this->value)) {
$this->value = array_shift($this->value);
}
$this->value = Str::encode($this->value);
return $this->column . ' NOT LIKE \'%' . $this->value . '%\'';
}
}