Abstract Class Yiisoft\Data\Cycle\Reader\FilterHandler\LikeHandler\BaseLikeHandler
Protected Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $escapingReplacements | array | Yiisoft\Data\Cycle\Reader\FilterHandler\LikeHandler\BaseLikeHandler |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getAsWhereArguments() | Yiisoft\Data\Cycle\Reader\QueryBuilderFilterHandler | |
| getFilterClass() | Yiisoft\Data\Cycle\Reader\FilterHandler\LikeHandler\BaseLikeHandler |
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| prepareValue() | Yiisoft\Data\Cycle\Reader\FilterHandler\LikeHandler\BaseLikeHandler |
Property Details
Method Details
| public abstract array getAsWhereArguments ( \Yiisoft\Data\Reader\FilterInterface $filter, array $handlers ) | ||
| $filter | \Yiisoft\Data\Reader\FilterInterface | |
| $handlers | array | |
public function getAsWhereArguments(FilterInterface $filter, array $handlers): array;
| public string getFilterClass ( ) |
#[\Override]
public function getFilterClass(): string
{
return Like::class;
}
| protected string prepareValue ( string|\Stringable $value, \Yiisoft\Data\Reader\Filter\LikeMode $mode ) | ||
| $value | string|\Stringable | |
| $mode | \Yiisoft\Data\Reader\Filter\LikeMode | |
protected function prepareValue(string|Stringable $value, LikeMode $mode): string
{
$value = strtr((string)$value, $this->escapingReplacements);
return match ($mode) {
LikeMode::Contains => '%' . $value . '%',
LikeMode::StartsWith => $value . '%',
LikeMode::EndsWith => '%' . $value,
};
}
Signup or Login in order to comment.