QueryFactory.php 954 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Drupal\Core\Entity\Query\Null;
  3. use Drupal\Core\Entity\EntityTypeInterface;
  4. use Drupal\Core\Entity\Query\QueryBase;
  5. use Drupal\Core\Entity\Query\QueryFactoryInterface;
  6. /**
  7. * Provides a factory for creating entity query objects for the null backend.
  8. */
  9. class QueryFactory implements QueryFactoryInterface {
  10. /**
  11. * The namespace of this class, the parent class etc.
  12. *
  13. * @var array
  14. */
  15. protected $namespaces;
  16. /**
  17. * Constructs a QueryFactory object.
  18. */
  19. public function __construct() {
  20. $this->namespaces = QueryBase::getNamespaces($this);
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function get(EntityTypeInterface $entity_type, $conjunction) {
  26. return new Query($entity_type, $conjunction, $this->namespaces);
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function getAggregate(EntityTypeInterface $entity_type, $conjunction) {
  32. return new Query($entity_type, $conjunction, $this->namespaces);
  33. }
  34. }