0 follower

Final Class Yiisoft\Db\QueryBuilder\Condition\NotIn

InheritanceYiisoft\Db\QueryBuilder\Condition\NotIn » Yiisoft\Db\QueryBuilder\Condition\AbstractIn
ImplementsYiisoft\Db\QueryBuilder\Condition\ConditionInterface

Condition that represents NOT IN operator.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Db\QueryBuilder\Condition\AbstractIn
fromArrayDefinition() Creates a condition based on the given operator and operands. Yiisoft\Db\QueryBuilder\Condition\AbstractIn

Method Details

Hide inherited methods

__construct() public method
public mixed __construct ( Yiisoft\Db\Expression\ExpressionInterface|iterable|string $column, iterable|Yiisoft\Db\Query\QueryInterface $values )
$column Yiisoft\Db\Expression\ExpressionInterface|iterable|string

The column name. If it's an array, a composite condition will be generated.

$values iterable|Yiisoft\Db\Query\QueryInterface

An array of values that {@see $columns} value should be among. If it's an empty array, the generated expression will be a false value if {@see $operator} is IN and empty if operator is NOT IN.

                final public function __construct(
    public readonly iterable|string|ExpressionInterface $column,
    public readonly iterable|QueryInterface $values,
) {}

            
fromArrayDefinition() public static method

Defined in: Yiisoft\Db\QueryBuilder\Condition\AbstractIn::fromArrayDefinition()

Creates a condition based on the given operator and operands.

public static Yiisoft\Db\QueryBuilder\Condition\NotIn fromArrayDefinition ( string $operator, array $operands )
$operator string
$operands array
throws InvalidArgumentException

If the number of operands isn't 2.

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