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