ExistsCondition
API reference › yii › db › conditions › ExistsCondition
Condition that represents EXISTS operator.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | ExistsCondition constructor. | ExistsCondition |
fromArrayDefinition() static | Creates object by array-definition as described in Query Builder – Operator format guide article. | ExistsCondition |
getOperator() | ExistsCondition | |
getQuery() | ExistsCondition |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $operator, yii\db\Query $query)ExistsCondition constructor.
Parameters
| Parameter | Type | Description |
|---|---|---|
$operator | string | The operator to use (e.g. EXISTS or NOT EXISTS) |
$query | yii\ | The Query object representing the sub-query. |
fromArrayDefinition()
Section titled “fromArrayDefinition() ”public static function fromArrayDefinition(mixed $operator, mixed $operands): staticCreates object by array-definition as described in Query Builder – Operator format guide article.
Parameters
| Parameter | Type | Description |
|---|---|---|
$operator | mixed | Operator in uppercase. |
$operands | mixed | Array of corresponding operands |
Returns
static
Throws
InvalidArgumentException: if input parameters are not suitable for this condition