Files
kiri-core/Database/Condition/LikeCondition.php
T
2021-02-24 18:34:57 +08:00

29 lines
447 B
PHP

<?php
declare(strict_types=1);
namespace Database\Condition;
use Snowflake\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) . '%\'';
}
}