function Query::getConnection

Same name in other branches
  1. 10 core/lib/Drupal/Core/Database/Query/Query.php \Drupal\Core\Database\Query\Query::getConnection()
  2. 11.x core/lib/Drupal/Core/Database/Query/Query.php \Drupal\Core\Database\Query\Query::getConnection()

Gets the database connection to be used for the query.

Return value

\Drupal\Core\Database\Connection The database connection to be used for the query.

File

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

Class

Query
Base class for query builders.

Namespace

Drupal\Core\Database\Query

Code

public function getConnection() {
    return $this->connection;
}

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