function StatementPrefetch::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Database/StatementPrefetch.php \Drupal\Core\Database\StatementPrefetch::__construct()
  2. 8.9.x core/lib/Drupal/Core/Database/StatementPrefetch.php \Drupal\Core\Database\StatementPrefetch::__construct()

Constructs a StatementPrefetch object.

Parameters

\PDO $pdo_connection: An object of the PDO class representing a database connection.

\Drupal\Core\Database\Connection $connection: The database connection.

string $query: The query string.

array $driver_options: Driver-specific options.

bool $row_count_enabled: (optional) Enables counting the rows matched. Defaults to FALSE.

File

core/lib/Drupal/Core/Database/StatementPrefetch.php, line 155

Class

StatementPrefetch
An implementation of StatementInterface that pre-fetches all data.

Namespace

Drupal\Core\Database

Code

public function __construct(\PDO $pdo_connection, Connection $connection, $query, array $driver_options = [], bool $row_count_enabled = FALSE) {
    $this->pdoConnection = $pdo_connection;
    $this->connection = $connection;
    $this->queryString = $query;
    $this->driverOptions = $driver_options;
    $this->rowCountEnabled = $row_count_enabled;
}

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