# ConjunctionCondition

> Class ConjunctionCondition

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [db](/docs/api/yii/db/index.md) › [conditions](/docs/api/yii/db/conditions/index.md) › ConjunctionCondition

| abstract class | `yii\db\conditions\ConjunctionCondition` |
| --- | --- |
| Implements | [`ConditionInterface`](/docs/api/yii/db/conditions/conditioninterface/index.md) |
| Since | 2.0.14 |
| Source | [`framework/db/conditions/ConjunctionCondition.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/db/conditions/ConjunctionCondition.php#L17) |

2 subclasses:

- [`AndCondition`](/docs/api/yii/db/conditions/andcondition/index.md)
- [`OrCondition`](/docs/api/yii/db/conditions/orcondition/index.md)

Class ConjunctionCondition

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-expressions"></span>`$expressions` protected | `mixed[]` | Default: `null`. | `ConjunctionCondition` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) |  | `ConjunctionCondition` |
| [`fromArrayDefinition()`](#method-fromArrayDefinition) static | Creates object by array-definition as described in [Query Builder – Operator format](/docs/guide/db-query-builder/index.md#operator-format) guide article. | `ConjunctionCondition` |
| [`getExpressions()`](#method-getExpressions) |  | `ConjunctionCondition` |
| [`getOperator()`](#method-getOperator) abstract | Returns the operator that is represented by this condition class, e.g. `AND`, `OR`. | `ConjunctionCondition` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(mixed $expressions)
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$expressions` | `mixed` |  |

### fromArrayDefinition() <span id="method-fromArrayDefinition"></span>

```php
public static function fromArrayDefinition(mixed $operator, mixed $operands): static
```

Creates object by array-definition as described in
[Query Builder – Operator format](/docs/guide/db-query-builder/index.md#operator-format) guide article.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$operator` | `mixed` | Operator in uppercase. |
| `$operands` | `mixed` | Array of corresponding operands |

**Returns**

`static`

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): if input parameters are not suitable for this condition

### getExpressions() <span id="method-getExpressions"></span>

```php
public function getExpressions(): mixed[]
```

**Returns**

`mixed[]`

### getOperator() <span id="method-getOperator"></span>

```php
abstract public function getOperator(): string
```

Returns the operator that is represented by this condition class, e.g. `AND`, `OR`.

**Returns**

`string`