0 follower

Final Class Yiisoft\Db\QueryBuilder\Condition\NotExists

InheritanceYiisoft\Db\QueryBuilder\Condition\NotExists » Yiisoft\Db\QueryBuilder\Condition\AbstractExists
ImplementsYiisoft\Db\QueryBuilder\Condition\ConditionInterface

Condition that represents NOT EXISTS operator that checks if a sub-query returns no rows.

Public Methods

Hide inherited methods

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

Method Details

Hide inherited methods

__construct() public method
public mixed __construct ( Yiisoft\Db\Query\QueryInterface $query )
$query Yiisoft\Db\Query\QueryInterface

The {@see \Yiisoft\Db\Query\QueryInterface} implementation representing the sub-query.

                final public function __construct(
    public readonly QueryInterface $query,
) {}

            
fromArrayDefinition() public static method

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

Creates a condition based on the given operator and operands.

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

If the number of operands isn't 1, and the first operand isn't a query object.

                final public static function fromArrayDefinition(string $operator, array $operands): static
{
    if (isset($operands[0]) && $operands[0] instanceof QueryInterface) {
        return new static($operands[0]);
    }
    throw new InvalidArgumentException(
        sprintf(
            'Sub-query for %s operator must be a Query object.',
            $operator,
        ),
    );
}