LikeConditionBuilder
API reference › yii › db › conditions › LikeConditionBuilder
3 subclasses
Class LikeConditionBuilder builds objects of LikeCondition
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$escapeCharacter protected | string| | Character used to escape special characters in LIKE conditions. Default: null. | LikeConditionBuilder |
$escapingReplacements protected | array | Map of chars to their replacements in LIKE conditions. Default: ['%' => '\. | LikeConditionBuilder |
$queryBuilder protected | yii\ | Default: null. | yii\ |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | ExpressionBuilderTrait constructor. | yii\ |
build() | Method builds the raw SQL from the $expression that will not be additionally escaped or quoted. | LikeConditionBuilder |
parseOperator() protected | LikeConditionBuilder |
Property details
Section titled “Property details”$escapeCharacter
Section titled “$escapeCharacter ”protected string|null $escapeCharacter = nullCharacter used to escape special characters in LIKE conditions.
By default it’s assumed to be \.
$escapingReplacements
Section titled “$escapingReplacements ”protected array $escapingReplacements = ['%' => '\%', '_' => '\_', '\\' => '\\\\']Map of chars to their replacements in LIKE conditions.
By default it’s configured to escape %, _ and \ with \.
Method details
Section titled “Method details”build()
Section titled “build() ”public function build(yii\db\ExpressionInterface|yii\db\conditions\LikeCondition $expression, array &$params = []): stringMethod builds the raw SQL from the $expression that will not be additionally escaped or quoted.
Parameters
| Parameter | Type | Description |
|---|---|---|
$expression | yii\|LikeCondition | The expression to be built. |
$params | array | The binding parameters. |
Returns
string: The raw SQL that will not be additionally escaped or quoted.
parseOperator()
Section titled “parseOperator() ”protected function parseOperator(string $operator): arrayParameters
| Parameter | Type | Description |
|---|---|---|
$operator | string |
Returns
array