Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Database/StatementPrefetch.php \Drupal\Core\Database\StatementPrefetch::__construct()
  2. 9 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 154

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;
}