Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / workspaces / src / EntityQuery / PgsqlQueryFactory.php
1 <?php
2
3 namespace Drupal\workspaces\EntityQuery;
4
5 use Drupal\Core\Database\Connection;
6 use Drupal\Core\Entity\EntityTypeInterface;
7 use Drupal\Core\Entity\Query\QueryBase;
8 use Drupal\Core\Entity\Query\Sql\pgsql\QueryFactory as BaseQueryFactory;
9 use Drupal\workspaces\WorkspaceManagerInterface;
10
11 /**
12  * Workspaces PostgreSQL-specific entity query implementation.
13  */
14 class PgsqlQueryFactory extends BaseQueryFactory {
15
16   /**
17    * The workspace manager.
18    *
19    * @var \Drupal\workspaces\WorkspaceManagerInterface
20    */
21   protected $workspaceManager;
22
23   /**
24    * Constructs a PgsqlQueryFactory object.
25    *
26    * @param \Drupal\Core\Database\Connection $connection
27    *   The database connection used by the entity query.
28    * @param \Drupal\workspaces\WorkspaceManagerInterface $workspace_manager
29    *   The workspace manager.
30    */
31   public function __construct(Connection $connection, WorkspaceManagerInterface $workspace_manager) {
32     $this->connection = $connection;
33     $this->workspaceManager = $workspace_manager;
34     $this->namespaces = QueryBase::getNamespaces($this);
35   }
36
37   /**
38    * {@inheritdoc}
39    */
40   public function get(EntityTypeInterface $entity_type, $conjunction) {
41     $class = QueryBase::getClass($this->namespaces, 'Query');
42     return new $class($entity_type, $conjunction, $this->connection, $this->namespaces, $this->workspaceManager);
43   }
44
45   /**
46    * {@inheritdoc}
47    */
48   public function getAggregate(EntityTypeInterface $entity_type, $conjunction) {
49     $class = QueryBase::getClass($this->namespaces, 'QueryAggregate');
50     return new $class($entity_type, $conjunction, $this->connection, $this->namespaces, $this->workspaceManager);
51   }
52
53 }