class EntityConditionGroup in JSON:API 8
Same name and namespace in other branches
- 8.2 src/Query/EntityConditionGroup.php \Drupal\jsonapi\Query\EntityConditionGroup
A condition group for the EntityQuery.
@internal
Hierarchy
- class \Drupal\jsonapi\Query\EntityConditionGroup
Expanded class hierarchy of EntityConditionGroup
4 files declare their use of EntityConditionGroup
- EntityConditionGroupNormalizer.php in src/Normalizer/ EntityConditionGroupNormalizer.php 
- EntityConditionGroupNormalizerTest.php in tests/src/ Kernel/ Normalizer/ EntityConditionGroupNormalizerTest.php 
- EntityResourceTest.php in tests/src/ Kernel/ Controller/ EntityResourceTest.php 
- TemporaryQueryGuard.php in src/Access/ TemporaryQueryGuard.php 
File
- src/Query/ EntityConditionGroup.php, line 10 
Namespace
Drupal\jsonapi\QueryView source
class EntityConditionGroup {
  /**
   * The AND conjunction value.
   *
   * @var array
   */
  protected static $allowedConjunctions = [
    'AND',
    'OR',
  ];
  /**
   * The conjunction.
   *
   * @var string
   */
  protected $conjunction;
  /**
   * The members of the condition group.
   *
   * @var \Drupal\jsonapi\Query\EntityCondition[]
   */
  protected $members;
  /**
   * Constructs a new condition group object.
   *
   * @param string $conjunction
   *   The group conjunction to use.
   * @param array $members
   *   (optional) The group conjunction to use.
   */
  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;
  }
  /**
   * The condition group conjunction.
   *
   * @return string
   *   The condition group conjunction.
   */
  public function conjunction() {
    return $this->conjunction;
  }
  /**
   * The members which belong to the the condition group.
   *
   * @return \Drupal\jsonapi\Query\EntityCondition[]
   *   The member conditions of this condition group.
   */
  public function members() {
    return $this->members;
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| EntityConditionGroup:: | protected static | property | The AND conjunction value. | |
| EntityConditionGroup:: | protected | property | The conjunction. | |
| EntityConditionGroup:: | protected | property | The members of the condition group. | |
| EntityConditionGroup:: | public | function | The condition group conjunction. | |
| EntityConditionGroup:: | public | function | The members which belong to the the condition group. | |
| EntityConditionGroup:: | public | function | Constructs a new condition group object. | 
