Class yii\db\conditions\LikeCondition

继承yii\db\conditions\LikeCondition » yii\db\conditions\SimpleCondition
实现yii\db\conditions\ConditionInterface
可用自版本2.0.14
源代码 https://github.com/yiisoft/yii2/blob/master/framework/db/conditions/LikeCondition.php

Class LikeCondition represents a LIKE condition.

受保护的属性

隐藏继承的属性

属性类型描述定义在
$escapingReplacements array|false Map of chars to their replacements, false if characters should not be escaped or either null or empty array if escaping is condition builder responsibility. yii\db\conditions\LikeCondition

属性详情

$escapingReplacements protected 属性

Map of chars to their replacements, false if characters should not be escaped or either null or empty array if escaping is condition builder responsibility. By default it's set to null.

方法详情

__construct() public 方法

public void __construct ( $column, $operator, $value )
$column string

The column name.

$operator string

The operator to use (e.g. LIKE, NOT LIKE, OR LIKE or OR NOT LIKE)

$value string[]|string

Single value or an array of values that $column 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.

fromArrayDefinition() public static 方法

Creates object by array-definition as described in Query Builder – Operator format guide article.

public static $this fromArrayDefinition ( $operator, $operands )
$operator string

Operator in uppercase.

$operands array

Array of corresponding operands

throws yii\base\InvalidArgumentException

if wrong number of operands have been given.

getEscapingReplacements() public 方法

public array|false getEscapingReplacements ( )
setEscapingReplacements() public 方法

This method allows to specify how to escape special characters in the value(s).

public void setEscapingReplacements ( $escapingReplacements )
$escapingReplacements