buildLikeCondition()
Creates an SQL expressions with the LIKE
operator.
public string buildLikeCondition ( $operator, $operands, &$params ) |
---|
$operator | string |
The operator to use (e.g. LIKE , NOT LIKE , OR LIKE or OR NOT LIKE ) |
$operands | array |
An array of two or three operands - The first operand is the column name.
- The second operand is a single value or an array of values that column value should be compared with. If it is an empty array the generated expression will be a
false value if operator is LIKE or OR LIKE , and empty if operator is NOT LIKE or OR NOT LIKE . - An optional third operand can also be provided to specify how to escape special characters in the value(s). The operand should be an array of mappings from the special characters to their escaped counterparts. If this operand is not provided, a default escape mapping will be used. You may use
false or an empty array to indicate the values are already escaped and no escape should be applied. Note that when using an escape mapping (or the third operand is not provided), the values will be automatically enclosed within a pair of percentage characters.
|
$params | array |
The binding parameters to be populated |
return | string |
The generated SQL expression |
throws | yii\base\InvalidParamException |
if wrong number of operands have been given. |
Please login to continue.