3 namespace Drupal\Core\Entity\Query;
5 use Drupal\Core\Entity\EntityTypeInterface;
8 * Defines an interface for QueryFactory classes.
10 interface QueryFactoryInterface {
13 * Instantiates an entity query for a given entity type.
15 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
16 * The entity type definition.
17 * @param string $conjunction
18 * The operator to use to combine conditions: 'AND' or 'OR'.
20 * @return \Drupal\Core\Entity\Query\QueryInterface
21 * An entity query for a specific configuration entity type.
23 public function get(EntityTypeInterface $entity_type, $conjunction);
26 * Instantiates an aggregation query object for a given entity type.
28 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
29 * The entity type definition.
30 * @param string $conjunction
31 * - AND: all of the conditions on the query need to match.
32 * - OR: at least one of the conditions on the query need to match.
34 * @return \Drupal\Core\Entity\Query\QueryAggregateInterface
35 * The query object that can query the given entity type.
37 * @throws \Drupal\Core\Entity\Query\QueryException
39 public function getAggregate(EntityTypeInterface $entity_type, $conjunction);