function QueryBase::conditionGroupFactory

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Query/QueryBase.php \Drupal\Core\Entity\Query\QueryBase::conditionGroupFactory()
  2. 8.9.x core/lib/Drupal/Core/Entity/Query/QueryBase.php \Drupal\Core\Entity\Query\QueryBase::conditionGroupFactory()
  3. 11.x core/lib/Drupal/Core/Entity/Query/QueryBase.php \Drupal\Core\Entity\Query\QueryBase::conditionGroupFactory()

Creates an object holding a group of conditions.

See andConditionGroup() and orConditionGroup() for more.

Parameters

string $conjunction:

  • AND (default): this is the equivalent of andConditionGroup().
  • OR: this is the equivalent of orConditionGroup().

Return value

\Drupal\Core\Entity\Query\ConditionInterface An object holding a group of conditions.

3 calls to QueryBase::conditionGroupFactory()
QueryBase::andConditionGroup in core/lib/Drupal/Core/Entity/Query/QueryBase.php
Creates a new group of conditions ANDed together.
QueryBase::orConditionGroup in core/lib/Drupal/Core/Entity/Query/QueryBase.php
Creates a new group of conditions ORed together.
QueryBase::__construct in core/lib/Drupal/Core/Entity/Query/QueryBase.php
Constructs this object.

File

core/lib/Drupal/Core/Entity/Query/QueryBase.php, line 215

Class

QueryBase
The base entity query class.

Namespace

Drupal\Core\Entity\Query

Code

protected function conditionGroupFactory($conjunction = 'AND') {
    $class = static::getClass($this->namespaces, 'Condition');
    return new $class($conjunction, $this, $this->namespaces);
}

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