function Query::__construct

Same name in this branch
  1. 9 core/lib/Drupal/Core/Config/Entity/Query/Query.php \Drupal\Core\Config\Entity\Query\Query::__construct()
  2. 9 core/lib/Drupal/Core/Entity/Query/Sql/Query.php \Drupal\Core\Entity\Query\Sql\Query::__construct()
  3. 9 core/lib/Drupal/Core/Entity/KeyValueStore/Query/Query.php \Drupal\Core\Entity\KeyValueStore\Query\Query::__construct()
Same name in other branches
  1. 7.x includes/database/query.inc \Query::__construct()
  2. 8.9.x core/lib/Drupal/Core/Config/Entity/Query/Query.php \Drupal\Core\Config\Entity\Query\Query::__construct()
  3. 8.9.x core/lib/Drupal/Core/Database/Query/Query.php \Drupal\Core\Database\Query\Query::__construct()
  4. 8.9.x core/lib/Drupal/Core/Entity/Query/Sql/Query.php \Drupal\Core\Entity\Query\Sql\Query::__construct()
  5. 8.9.x core/lib/Drupal/Core/Entity/KeyValueStore/Query/Query.php \Drupal\Core\Entity\KeyValueStore\Query\Query::__construct()
  6. 10 core/lib/Drupal/Core/Config/Entity/Query/Query.php \Drupal\Core\Config\Entity\Query\Query::__construct()
  7. 10 core/lib/Drupal/Core/Database/Query/Query.php \Drupal\Core\Database\Query\Query::__construct()
  8. 10 core/lib/Drupal/Core/Entity/Query/Sql/Query.php \Drupal\Core\Entity\Query\Sql\Query::__construct()
  9. 10 core/lib/Drupal/Core/Entity/KeyValueStore/Query/Query.php \Drupal\Core\Entity\KeyValueStore\Query\Query::__construct()
  10. 11.x core/lib/Drupal/Core/Config/Entity/Query/Query.php \Drupal\Core\Config\Entity\Query\Query::__construct()
  11. 11.x core/lib/Drupal/Core/Database/Query/Query.php \Drupal\Core\Database\Query\Query::__construct()
  12. 11.x core/lib/Drupal/Core/Entity/Query/Sql/Query.php \Drupal\Core\Entity\Query\Sql\Query::__construct()
  13. 11.x core/lib/Drupal/Core/Entity/KeyValueStore/Query/Query.php \Drupal\Core\Entity\KeyValueStore\Query\Query::__construct()

Constructs a Query object.

Parameters

\Drupal\Core\Database\Connection $connection: Database connection object.

array $options: Array of query options.

7 calls to Query::__construct()
Delete::__construct in core/lib/Drupal/Core/Database/Query/Delete.php
Constructs a Delete object.
Insert::__construct in core/lib/Drupal/Core/Database/Query/Insert.php
Constructs an Insert object.
Merge::__construct in core/lib/Drupal/Core/Database/Query/Merge.php
Constructs a Merge object.
Select::__construct in core/lib/Drupal/Core/Database/Query/Select.php
Constructs a Select object.
Truncate::__construct in core/lib/Drupal/Core/Database/Query/Truncate.php
Constructs a Truncate query object.

... See full list

7 methods override Query::__construct()
Delete::__construct in core/lib/Drupal/Core/Database/Query/Delete.php
Constructs a Delete object.
Insert::__construct in core/lib/Drupal/Core/Database/Query/Insert.php
Constructs an Insert object.
Merge::__construct in core/lib/Drupal/Core/Database/Query/Merge.php
Constructs a Merge object.
Select::__construct in core/lib/Drupal/Core/Database/Query/Select.php
Constructs a Select object.
Truncate::__construct in core/lib/Drupal/Core/Database/Query/Truncate.php
Constructs a Truncate query object.

... See full list

File

core/lib/Drupal/Core/Database/Query/Query.php, line 73

Class

Query
Base class for query builders.

Namespace

Drupal\Core\Database\Query

Code

public function __construct(Connection $connection, $options) {
    $this->uniqueIdentifier = uniqid('', TRUE);
    $this->connection = $connection;
    $this->connectionKey = $this->connection
        ->getKey();
    $this->connectionTarget = $this->connection
        ->getTarget();
    $this->queryOptions = $options;
}

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