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

29 lines
448 B
PHP

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