0 follower

Final Class Yiisoft\Yii\DataView\Filter\Factory\LikeFilterFactory

InheritanceYiisoft\Yii\DataView\Filter\Factory\LikeFilterFactory
ImplementsYiisoft\Yii\DataView\Filter\Factory\FilterFactoryInterface

Factory for creating pattern matching (LIKE) filters.

This factory creates filters that perform pattern matching using SQL LIKE operator semantics. It supports both case-sensitive and case-insensitive matching, which can be configured during factory instantiation.

Pattern matching follows SQL LIKE operator rules:

  • % matches any sequence of characters
  • _ matches any single character

Method Details

Hide inherited methods

__construct() public method

public __construct( boolean|null $caseSensitive null ): mixed
$caseSensitive boolean|null

Whether the pattern matching should be case-sensitive.

  • true for case-sensitive matching
  • false for case-insensitive matching
  • null to use the data reader's default behavior

                public function __construct(
    private readonly ?bool $caseSensitive = null,
) {}

            
create() public method

public create( string $property, string $value ): \Yiisoft\Data\Reader\Filter\Like
$property string
$value string

                public function create(string $property, string $value): Like
{
    return new Like($property, $value, $this->caseSensitive);
}