QueryFactoryInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Drupal\Core\Entity\Query;
  3. use Drupal\Core\Entity\EntityTypeInterface;
  4. /**
  5. * Defines an interface for QueryFactory classes.
  6. */
  7. interface QueryFactoryInterface {
  8. /**
  9. * Instantiates an entity query for a given entity type.
  10. *
  11. * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
  12. * The entity type definition.
  13. * @param string $conjunction
  14. * The operator to use to combine conditions: 'AND' or 'OR'.
  15. *
  16. * @return \Drupal\Core\Entity\Query\QueryInterface
  17. * An entity query for a specific configuration entity type.
  18. */
  19. public function get(EntityTypeInterface $entity_type, $conjunction);
  20. /**
  21. * Instantiates an aggregation query object for a given entity type.
  22. *
  23. * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
  24. * The entity type definition.
  25. * @param string $conjunction
  26. * - AND: all of the conditions on the query need to match.
  27. * - OR: at least one of the conditions on the query need to match.
  28. *
  29. * @return \Drupal\Core\Entity\Query\QueryAggregateInterface
  30. * The query object that can query the given entity type.
  31. *
  32. * @throws \Drupal\Core\Entity\Query\QueryException
  33. */
  34. public function getAggregate(EntityTypeInterface $entity_type, $conjunction);
  35. }