類別 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 |
反轉傳入的 condition 條件。
公開方法
方法 | 描述 | 定義於 |
---|---|---|
__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 |
對應運算元的陣列 |
throws | 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));
}
註冊 或 登入 以進行評論。