You are here

public function HeartbeatEntityQuery::andConditionGroup in Heartbeat 8

Creates a new group of conditions ANDed together.

For example, consider a drawing entity type with a 'figures' multi-value field containing 'shape' and 'color' columns. To find all drawings containing both a red triangle and a blue circle:

$query = \Drupal::entityQuery('drawing');
$group = $query
  ->andConditionGroup()
  ->condition('figures.color', 'red')
  ->condition('figures.shape', 'triangle');
$query
  ->condition($group);
$group = $query
  ->andConditionGroup()
  ->condition('figures.color', 'blue')
  ->condition('figures.shape', 'circle');
$query
  ->condition($group);
$entity_ids = $query
  ->execute();

Return value

\Drupal\Core\Entity\Query\ConditionInterface

Overrides QueryInterface::andConditionGroup

File

src/HeartbeatEntityQuery.php, line 349

Class

HeartbeatEntityQuery
Created by IntelliJ IDEA. User: logicp Date: 5/28/17 Time: 1:37 PM

Code

public function andConditionGroup() {

  // TODO: Implement andConditionGroup() method.
}