類別 yii\db\conditions\BetweenCondition
繼承關係 | yii\db\conditions\BetweenCondition |
---|---|
實作 | yii\db\conditions\ConditionInterface |
自版本起可用 | 2.0.14 |
原始碼 | https://github.com/yiisoft/yii2/blob/master/framework/db/conditions/BetweenCondition.php |
BetweenCondition 類別代表 BETWEEN
條件。
公開方法
方法詳情
建立具有 BETWEEN
運算子的條件。
public void __construct ( $column, $operator, $intervalStart, $intervalEnd ) | ||
$column | mixed |
$operator 左側的字面值 |
$operator | string |
要使用的運算子 (例如 |
$intervalStart | mixed |
間隔的開始 |
$intervalEnd | mixed |
間隔的結束 |
public function __construct($column, $operator, $intervalStart, $intervalEnd)
{
$this->column = $column;
$this->operator = $operator;
$this->intervalStart = $intervalStart;
$this->intervalEnd = $intervalEnd;
}
依據陣列定義建立物件,如 查詢建構器 – 運算子格式 指南文章中所述。
public static $this fromArrayDefinition ( $operator, $operands ) | ||
$operator | string |
大寫的運算子。 |
$operands | array |
對應運算元的陣列 |
throws | yii\base\InvalidArgumentException |
如果給定的運算元數量錯誤。 |
---|
public static function fromArrayDefinition($operator, $operands)
{
if (!isset($operands[0], $operands[1], $operands[2])) {
throw new InvalidArgumentException("Operator '$operator' requires three operands.");
}
return new static($operands[0], $operator, $operands[1], $operands[2]);
}
public mixed getIntervalStart ( ) |
public function getIntervalStart()
{
return $this->intervalStart;
}
註冊 或 登入 以進行評論。