public function Connection::prepareQuery in Drupal driver for SQL Server and SQL Azure 4.0.x
Same name and namespace in other branches
- 3.1.x src/Driver/Database/sqlsrv/Connection.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Connection::prepareQuery()
Prepares a query string and returns the prepared statement.
This method caches prepared statements, reusing them when possible. It also prefixes tables names enclosed in curly-braces and, optionally, quotes identifiers enclosed in square brackets.
Parameters
$query: The query string as SQL, with curly-braces surrounding the table names.
bool $quote_identifiers: (optional) Quote any identifiers enclosed in square brackets. Defaults to TRUE.
Return value
\Drupal\Core\Database\StatementInterface A PDO prepared statement ready for its execute() method.
Overrides Connection::prepareQuery
Deprecated
in drupal:9.1.0 and is removed from drupal:10.0.0. Use ::prepareStatement instead.
See also
https://www.drupal.org/node/3137786
File
- src/
Driver/ Database/ sqlsrv/ Connection.php, line 378
Class
- Connection
- Sqlsvr implementation of \Drupal\Core\Database\Connection.
Namespace
Drupal\sqlsrv\Driver\Database\sqlsrvCode
public function prepareQuery($query, $quote_identifiers = TRUE) {
@trigger_error('Connection::prepareQuery() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use ::prepareStatement() instead. See https://www.drupal.org/node/3137786', E_USER_DEPRECATED);
return $this
->prepareStatement($query, [
'allow_square_brackets' => !$quote_identifiers,
]);
}