0 追蹤者

類別 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 條件。

方法詳情

隱藏繼承方法

__construct() public method

建立具有 BETWEEN 運算子的條件。

public void __construct ( $column, $operator, $intervalStart, $intervalEnd )
$column mixed

$operator 左側的字面值

$operator string

要使用的運算子 (例如 BETWEENNOT BETWEEN)

$intervalStart mixed

間隔的開始

$intervalEnd mixed

間隔的結束

                public function __construct($column, $operator, $intervalStart, $intervalEnd)
{
    $this->column = $column;
    $this->operator = $operator;
    $this->intervalStart = $intervalStart;
    $this->intervalEnd = $intervalEnd;
}

            
fromArrayDefinition() public static method

依據陣列定義建立物件,如 查詢建構器 – 運算子格式 指南文章中所述。

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]);
}

            
getColumn() public method

public mixed getColumn ( )

                public function getColumn()
{
    return $this->column;
}

            
getIntervalEnd() public method

public mixed getIntervalEnd ( )

                public function getIntervalEnd()
{
    return $this->intervalEnd;
}

            
getIntervalStart() public method

public mixed getIntervalStart ( )

                public function getIntervalStart()
{
    return $this->intervalStart;
}

            
getOperator() public method

public string getOperator ( )

                public function getOperator()
{
    return $this->operator;
}