LikeConditionBuilder
extends LikeConditionBuilder
in package
Class LikeConditionBuilder builds objects of [[LikeCondition]]
Table of Contents
Properties
- $escapeCharacter : string|null
- $escapingReplacements : array<string|int, mixed>
- $queryBuilder : QueryBuilder
Methods
- __construct() : mixed
- ExpressionBuilderTrait constructor.
- build() : string
- Method builds the raw SQL from the $expression that will not be additionally escaped or quoted.
- parseOperator() : array<string|int, mixed>
- getEscapeSql() : string
Properties
$escapeCharacter
protected
string|null
$escapeCharacter
= '\\'
character used to escape special characters in LIKE conditions.
By default it's assumed to be \
.
$escapingReplacements
protected
array<string|int, mixed>
$escapingReplacements
= ['%' => '\%', '_' => '\_', '\\' => '\\\\']
map of chars to their replacements in LIKE conditions.
By default it's configured to escape %
, _
and \
with \
.
$queryBuilder
protected
QueryBuilder
$queryBuilder
Methods
__construct()
ExpressionBuilderTrait constructor.
public
__construct(QueryBuilder $queryBuilder) : mixed
Parameters
- $queryBuilder : QueryBuilder
build()
Method builds the raw SQL from the $expression that will not be additionally escaped or quoted.
public
build(ExpressionInterface|LikeCondition $expression[, array<string|int, mixed> &$params = [] ]) : string
Parameters
- $expression : ExpressionInterface|LikeCondition
-
the expression to be built.
- $params : array<string|int, mixed> = []
-
the binding parameters.
Return values
string —the raw SQL that will not be additionally escaped or quoted.
parseOperator()
protected
parseOperator(string $operator) : array<string|int, mixed>
Parameters
- $operator : string
Return values
array<string|int, mixed>getEscapeSql()
private
getEscapeSql() : string