没有命名空间的类 yii yii\base yii\behaviors yii\caching yii\captcha yii\console yii\console\controllers yii\console\widgets yii\data yii\db yii\db\conditions yii\db\cubrid yii\db\cubrid\conditions yii\db\mssql yii\db\mssql\conditions yii\db\mysql yii\db\oci yii\db\oci\conditions yii\db\pgsql yii\db\sqlite yii\db\sqlite\conditions yii\di yii\filters yii\filters\auth yii\grid yii\helpers yii\i18n yii\log yii\mail yii\mutex yii\rbac yii\rest yii\test yii\validators yii\web yii\widgets

Class yii\db\conditions\LikeCondition

继承yii\db\conditions\LikeCondition » yii\db\conditions\SimpleCondition
实现yii\db\conditions\ConditionInterface
可用版本自2.0.14
源码 https://github.com/yiichina/yii2/blob/api/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 受保护 属性

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 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() 公共 静态 方法

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 array|false getEscapingReplacements()
setEscapingReplacements() 公共 方法

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

public void setEscapingReplacements($escapingReplacements)
$escapingReplacements