You are here

public function Connection::__construct in Drupal driver for SQL Server and SQL Azure 8.2

Same name in this branch
  1. 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Connection.php \Drupal\Driver\Database\sqlsrv\Connection::__construct()
  2. 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/PDO/Connection.php \Drupal\Driver\Database\sqlsrv\PDO\Connection::__construct()
Same name and namespace in other branches
  1. 8 drivers/lib/Drupal/Driver/Database/sqlsrv/Connection.php \Drupal\Driver\Database\sqlsrv\Connection::__construct()
  2. 3.0.x drivers/lib/Drupal/Driver/Database/sqlsrv/Connection.php \Drupal\Driver\Database\sqlsrv\Connection::__construct()

Constructs a Connection object.

Overrides Connection::__construct

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Connection.php, line 87
Definition of Drupal\Driver\Database\sqlsrv\Connection

Class

Connection
Temporary tables: temporary table support is done by means of global temporary tables (#) to avoid the use of DIRECT QUERIES. You can enable and disable the use of direct queries with $this->driver_settings->defaultDirectQuery =…

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function __construct(\PDO $connection, array $connection_options) {

  // Initialize settings.
  $this->driver_settings = $connection_options['driver_settings'];

  // Needs to happen before parent construct.
  $this->statementClass = Statement::class;
  parent::__construct($connection, $connection_options);

  // This driver defaults to transaction support, except if explicitly passed FALSE.
  $this->transactionSupport = !isset($connection_options['transactions']) || $connection_options['transactions'] !== false;
  $this->transactionalDDLSupport = $this->transactionSupport;

  // Store connection options for future reference.
  $this->connectionOptions =& $connection_options;
}