function Query::__construct

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

Constructs a Query object.

Parameters

DatabaseConnection $connection: Database connection object.

array $options: Array of query options.

6 calls to Query::__construct()
DeleteQuery::__construct in includes/database/query.inc
Constructs a DeleteQuery object.
InsertQuery::__construct in includes/database/query.inc
Constructs an InsertQuery object.
MergeQuery::__construct in includes/database/query.inc
Constructs a MergeQuery object.
SelectQuery::__construct in includes/database/select.inc
Constructs a Query object.
TruncateQuery::__construct in includes/database/query.inc
Constructs a TruncateQuery object.

... See full list

6 methods override Query::__construct()
DeleteQuery::__construct in includes/database/query.inc
Constructs a DeleteQuery object.
InsertQuery::__construct in includes/database/query.inc
Constructs an InsertQuery object.
MergeQuery::__construct in includes/database/query.inc
Constructs a MergeQuery object.
SelectQuery::__construct in includes/database/select.inc
Constructs a Query object.
TruncateQuery::__construct in includes/database/query.inc
Constructs a TruncateQuery object.

... See full list

File

includes/database/query.inc, line 330

Class

Query
Base class for query builders.

Code

public function __construct(DatabaseConnection $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.