没有命名空间的类 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\BetweenColumnsCondition

继承yii\db\conditions\BetweenColumnsCondition
实现yii\db\conditions\ConditionInterface
可用版本自2.0.14
源码 https://github.com/yiichina/yii2/blob/api/framework/db/conditions/BetweenColumnsCondition.php

Class BetweenColumnCondition represents a BETWEEN condition where values is between two columns. For example:

new BetweenColumnsCondition(42, 'BETWEEN', 'min_value', 'max_value')
// Will be build to:
// 42 BETWEEN min_value AND max_value

And a more complex example:

new BetweenColumnsCondition(
   new Expression('NOW()'),
   'NOT BETWEEN',
   (new Query)->select('time')->from('log')->orderBy('id ASC')->limit(1),
   'update_time'
);

// Will be built to:
// NOW() NOT BETWEEN (SELECT time FROM log ORDER BY id ASC LIMIT 1) AND update_time

方法详情

__construct() 公共 方法

Creates a condition with the BETWEEN operator.

public void __construct($value, $operator, $intervalStartColumn, $intervalEndColumn)
$value
$operator string

The operator to use (e.g. BETWEEN or NOT BETWEEN)

$intervalStartColumn string|yii\db\ExpressionInterface

The column name or expression that is a beginning of the interval

$intervalEndColumn string|yii\db\ExpressionInterface

The column name or expression that is an end of the interval

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.

getIntervalEndColumn() 公共 方法

public string|yii\db\ExpressionInterface|yii\db\Query getIntervalEndColumn()
getIntervalStartColumn() 公共 方法

public string|yii\db\ExpressionInterface|yii\db\Query getIntervalStartColumn()
getOperator() 公共 方法

public string getOperator()
getValue() 公共 方法

public mixed getValue()