function EntityConditionGroup::__construct

Same name in other branches
  1. 8.9.x core/modules/jsonapi/src/Query/EntityConditionGroup.php \Drupal\jsonapi\Query\EntityConditionGroup::__construct()
  2. 10 core/modules/jsonapi/src/Query/EntityConditionGroup.php \Drupal\jsonapi\Query\EntityConditionGroup::__construct()
  3. 11.x core/modules/jsonapi/src/Query/EntityConditionGroup.php \Drupal\jsonapi\Query\EntityConditionGroup::__construct()

Constructs a new condition group object.

Parameters

string $conjunction: The group conjunction to use.

array $members: (optional) The group conjunction to use.

File

core/modules/jsonapi/src/Query/EntityConditionGroup.php, line 45

Class

EntityConditionGroup
A condition group for the EntityQuery.

Namespace

Drupal\jsonapi\Query

Code

public function __construct($conjunction, array $members = []) {
    if (!in_array($conjunction, self::$allowedConjunctions)) {
        throw new \InvalidArgumentException('Allowed conjunctions: AND, OR.');
    }
    $this->conjunction = $conjunction;
    $this->members = $members;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.