Abstract Class Yiisoft\Db\QueryBuilder\Condition\AbstractExists
Represents EXISTS and NOT EXISTS operators.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $query | Yiisoft\Db\Query\QueryInterface | Yiisoft\Db\QueryBuilder\Condition\AbstractExists |
Public 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 |
Property Details
Method Details
| public __construct( Yiisoft\Db\Query\QueryInterface $query ): mixed | ||
| $query | Yiisoft\Db\Query\QueryInterface |
The Yiisoft\Db\Query\QueryInterface implementation representing the sub-query. |
final public function __construct(
public readonly QueryInterface $query,
) {}
Creates a condition based on the given operator and operands.
| public static fromArrayDefinition( string $operator, array $operands ): Yiisoft\Db\QueryBuilder\Condition\AbstractExists | ||
| $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,
),
);
}
Signup or Login in order to comment.