public QueryInterface::andConditionGroup()
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();
\Drupal\Core\Entity\Query\ConditionInterface
public function andConditionGroup();
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Query!QueryInterface.php/function/QueryInterface::andConditionGroup/8.1.x