クラス yii\db\conditions\NotCondition
| 継承 | yii\db\conditions\NotCondition |
|---|---|
| 実装 | yii\db\conditions\ConditionInterface |
| 利用可能バージョン | 2.0.14 |
| ソースコード | https://github.com/yiisoft/yii2/blob/master/framework/db/conditions/NotCondition.php |
渡された条件を反転する条件。
パブリックメソッド
| メソッド | 説明 | 定義元 |
|---|---|---|
| __construct() | NotCondition コンストラクタ。 | yii\db\conditions\NotCondition |
| fromArrayDefinition() | クエリビルダー – 演算子形式ガイド記事で説明されているように、配列定義によってオブジェクトを作成します。 | yii\db\conditions\NotCondition |
| getCondition() | yii\db\conditions\NotCondition |
メソッド詳細
NotCondition コンストラクタ。
| public void __construct ( $condition ) | ||
| $condition | mixed |
否定される条件 |
public function __construct($condition)
{
$this->condition = $condition;
}
クエリビルダー – 演算子形式ガイド記事で説明されているように、配列定義によってオブジェクトを作成します。
| public static $this fromArrayDefinition ( $operator, $operands ) | ||
| $operator | string |
大文字の演算子。 |
| $operands | array |
対応するオペランドの配列 |
| スロー | yii\base\InvalidArgumentException |
オペランドの数が間違っている場合。 |
|---|---|---|
public static function fromArrayDefinition($operator, $operands)
{
if (count($operands) !== 1) {
throw new InvalidArgumentException("Operator '$operator' requires exactly one operand.");
}
return new static(array_shift($operands));
}
コメントするにはサインアップまたはログインしてください。