Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Connection.php

function Connection::prepareStatement

Same name in this branch
  1. 11.1.x core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::prepareStatement()
  2. 11.1.x core/modules/pgsql/src/Driver/Database/pgsql/Connection.php \Drupal\pgsql\Driver\Database\pgsql\Connection::prepareStatement()

Overrides Connection::prepareStatement

File

core/modules/sqlite/src/Driver/Database/sqlite/Connection.php, line 401

Class

Connection
SQLite implementation of \Drupal\Core\Database\Connection.

Namespace

Drupal\sqlite\Driver\Database\sqlite

Code

public function prepareStatement(string $query, array $options, bool $allow_row_count = FALSE) : StatementInterface {
    assert(!isset($options['return']), 'Passing "return" option to prepareStatement() has no effect. See https://www.drupal.org/node/3185520');
    try {
        $query = $this->preprocessStatement($query, $options);
        $statement = new Statement($this->connection, $this, $query, $options['pdo'] ?? [], $allow_row_count);
    } catch (\Exception $e) {
        $this->exceptionHandler()
            ->handleStatementException($e, $query, $options);
    }
    return $statement;
}
RSS feed
Powered by Drupal