function QueryTrait::__construct

Same name in other branches
  1. 9 core/modules/workspaces/src/EntityQuery/QueryTrait.php \Drupal\workspaces\EntityQuery\QueryTrait::__construct()
  2. 8.9.x core/modules/workspaces/src/EntityQuery/QueryTrait.php \Drupal\workspaces\EntityQuery\QueryTrait::__construct()
  3. 10 core/modules/workspaces/src/EntityQuery/QueryTrait.php \Drupal\workspaces\EntityQuery\QueryTrait::__construct()

Constructs a Query object.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition.

string $conjunction:

  • AND: all of the conditions on the query need to match.
  • OR: at least one of the conditions on the query need to match.

\Drupal\Core\Database\Connection $connection: The database connection to run the query against.

array $namespaces: List of potential namespaces of the classes belonging to this query.

\Drupal\workspaces\WorkspaceManagerInterface $workspace_manager: The workspace manager.

\Drupal\workspaces\WorkspaceInformationInterface $workspace_information: The workspace information service.

File

core/modules/workspaces/src/EntityQuery/QueryTrait.php, line 48

Class

QueryTrait
Provides workspaces-specific helpers for altering entity queries.

Namespace

Drupal\workspaces\EntityQuery

Code

public function __construct(EntityTypeInterface $entity_type, $conjunction, Connection $connection, array $namespaces, WorkspaceManagerInterface $workspace_manager, WorkspaceInformationInterface $workspace_information) {
    parent::__construct($entity_type, $conjunction, $connection, $namespaces);
    $this->workspaceManager = $workspace_manager;
    $this->workspaceInfo = $workspace_information;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.