You are here

public function EntityConditionGroup::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 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;
}