protected function Connection::quoteIdentifier in Drupal driver for SQL Server and SQL Azure 3.0.x
Same name and namespace in other branches
- 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Connection.php \Drupal\Driver\Database\sqlsrv\Connection::quoteIdentifier()
- 8 drivers/lib/Drupal/Driver/Database/sqlsrv/Connection.php \Drupal\Driver\Database\sqlsrv\Connection::quoteIdentifier()
Quotes an identifier if it matches a SQL Server reserved keyword.
Parameters
string $identifier: The field to check.
Return value
string The identifier, quoted if it matches a SQL Server reserved keyword.
1 call to Connection::quoteIdentifier()
- Connection::escapeField in drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ Connection.php - Encapsulates field names in brackets when necessary.
File
- drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ Connection.php, line 959
Class
- Connection
- Sqlsvr implementation of \Drupal\Core\Database\Connection.
Namespace
Drupal\Driver\Database\sqlsrvCode
protected function quoteIdentifier($identifier) {
if (strpos($identifier, '.') !== FALSE) {
list($table, $identifier) = explode('.', $identifier, 2);
}
if (in_array(strtolower($identifier), $this->reservedKeyWords, TRUE)) {
// Quote the string for SQLServer reserved keywords.
$identifier = '[' . $identifier . ']';
}
return isset($table) ? $table . '.' . $identifier : $identifier;
}