0 フォロワー

クラス yii\db\conditions\SimpleCondition

継承yii\db\conditions\SimpleCondition
実装yii\db\conditions\ConditionInterface
サブクラスyii\db\conditions\LikeCondition
利用可能バージョン2.0.14
ソースコード https://github.com/yiisoft/yii2/blob/master/framework/db/conditions/SimpleCondition.php

クラス SimpleCondition は、"column" operator value のような単純な条件を表します。

パブリックメソッド

継承されたメソッドを非表示

メソッド 説明 定義元
__construct() SimpleCondition コンストラクタ yii\db\conditions\SimpleCondition
fromArrayDefinition() クエリビルダー – 演算子形式 ガイド記事で説明されているように、配列定義によってオブジェクトを作成します。 yii\db\conditions\SimpleCondition
getColumn() yii\db\conditions\SimpleCondition
getOperator() yii\db\conditions\SimpleCondition
getValue() yii\db\conditions\SimpleCondition

メソッドの詳細

継承されたメソッドを非表示

__construct() パブリックメソッド

SimpleCondition コンストラクタ

public void __construct ( $column, $operator, $value )
$column mixed

$operator の左側のリテラル

$operator string

使用する演算子。><=など、何でも使用できます。

$value mixed

$operator の右側のリテラル

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

            
fromArrayDefinition() パブリックスタティックメソッド

クエリビルダー – 演算子形式 ガイド記事で説明されているように、配列定義によってオブジェクトを作成します。

public static $this fromArrayDefinition ( $operator, $operands )
$operator string

大文字の演算子。

$operands array

対応するオペランドの配列

throws yii\base\InvalidArgumentException

オペランドの数が間違っている場合。

                public static function fromArrayDefinition($operator, $operands)
{
    if (count($operands) !== 2) {
        throw new InvalidArgumentException("Operator '$operator' requires two operands.");
    }
    return new static($operands[0], $operator, $operands[1]);
}

            
getColumn() パブリックメソッド

public mixed getColumn ( )

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

            
getOperator() パブリックメソッド

public string getOperator ( )

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

            
getValue() パブリックメソッド

public mixed getValue ( )

                public function getValue()
{
    return $this->value;
}