3 namespace Drupal\Core\Entity\Query;
4 use Drupal\Core\Entity\EntityTypeInterface;
7 * Defines an interface for QueryFactory classes.
9 interface QueryFactoryInterface {
12 * Instantiates an entity query for a given entity type.
14 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
15 * The entity type definition.
16 * @param string $conjunction
17 * The operator to use to combine conditions: 'AND' or 'OR'.
19 * @return \Drupal\Core\Entity\Query\QueryInterface
20 * An entity query for a specific configuration entity type.
22 public function get(EntityTypeInterface $entity_type, $conjunction);
25 * Instantiates an aggregation query object for a given entity type.
27 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
28 * The entity type definition.
29 * @param string $conjunction
30 * - AND: all of the conditions on the query need to match.
31 * - OR: at least one of the conditions on the query need to match.
33 * @return \Drupal\Core\Entity\Query\QueryAggregateInterface
34 * The query object that can query the given entity type.
36 * @throws \Drupal\Core\Entity\Query\QueryException
38 public function getAggregate(EntityTypeInterface $entity_type, $conjunction);