function Connection::__construct
Constructs a Connection object.
Parameters
\PDO $connection: An object of the PDO class representing a database connection.
array $connection_options: An array of options for the connection. May include the following:
- prefix
- namespace
- Other driver-specific options.
Overrides Connection::__construct
1 call to Connection::__construct()
- Connection::__construct in core/
modules/ system/ tests/ modules/ driver_test/ src/ Driver/ Database/ DrivertestMysqlDeprecatedVersion/ Connection.php - Constructs a Connection object.
1 method overrides Connection::__construct()
- Connection::__construct in core/
modules/ system/ tests/ modules/ driver_test/ src/ Driver/ Database/ DrivertestMysqlDeprecatedVersion/ Connection.php - Constructs a Connection object.
File
-
core/
lib/ Drupal/ Core/ Database/ Driver/ mysql/ Connection.php, line 340
Class
- Connection
- MySQL implementation of \Drupal\Core\Database\Connection.
Namespace
Drupal\Core\Database\Driver\mysqlCode
public function __construct(\PDO $connection, array $connection_options = []) {
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;
// MySQL never supports transactional DDL.
$this->transactionalDDLSupport = FALSE;
$this->connectionOptions = $connection_options;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.