Files
kiri-databases/Condition/LikeCondition.php
T
as2252258 ef3e874c0c Revert "改名"
This reverts commit fdf58326
2022-01-08 18:49:06 +08:00

29 lines
442 B
PHP

<?php
declare(strict_types=1);
namespace Database\Condition;
use Kiri\Core\Str;
/**
* Class LikeCondition
* @package Database\Condition
*/
class LikeCondition extends Condition
{
public string $pos = '';
/**
* @return string
*/
public function builder(): string
{
if (!is_string($this->value)) {
$this->value = array_shift($this->value);
}
return $this->column . ' LIKE \'%' . addslashes($this->value) . '%\'';
}
}