クラス 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() | BETWEEN演算子を持つ条件を作成します。 |
yii\db\conditions\BetweenCondition |
| fromArrayDefinition() | クエリビルダー - 演算子形式ガイド記事で説明されているように、配列定義によってオブジェクトを作成します。 | yii\db\conditions\BetweenCondition |
| getColumn() | yii\db\conditions\BetweenCondition | |
| getIntervalEnd() | yii\db\conditions\BetweenCondition | |
| getIntervalStart() | yii\db\conditions\BetweenCondition | |
| getOperator() | yii\db\conditions\BetweenCondition |
メソッド詳細
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;
}
サインアップ または ログイン してコメントしてください。