0 follower

Class yii\db\conditions\InCondition

Inheritanceyii\db\conditions\InCondition
Implementsyii\db\conditions\ConditionInterface
Available since version2.0.14
Source Code https://github.com/yiisoft/yii2/blob/master/framework/db/conditions/InCondition.php

Class InCondition represents IN condition.

Method Details

Hide inherited methods

__construct() public method

SimpleCondition constructor

public void __construct ( $column, $operator, $values )
$column
$operator string

The operator to use (e.g. IN or NOT IN)

$values

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

            
fromArrayDefinition() public static method

Creates object by array-definition as described in Query Builder – Operator format guide article.

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

Operator in uppercase.

$operands array

Array of corresponding operands

throws yii\base\InvalidArgumentException

if wrong number of operands have been given.

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

            
getColumn() public method

public mixed getColumn ( )

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

            
getOperator() public method

public string getOperator ( )

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

            
getValues() public method

public yii\db\ExpressionInterface[]|string[]|integer[] getValues ( )

                public function getValues()
{
    return $this->values;
}