public function __construct(object
$connection, array
$connection_options) { assert(count($this->identifierQuotes
) === 2 && Inspector::
assertAllStrings($this->identifierQuotes
), '\Drupal\Core\Database\Connection::$identifierQuotes must contain 2 string values'
);
// Manage the table prefix.
$connection_options['prefix'
] =
$connection_options['prefix'
] ?? '';
$this->
setPrefix($connection_options['prefix'
]);
// Work out the database driver namespace if none is provided. This normally
// written to setting.php by installer or set by
// \Drupal\Core\Database\Database::parseConnectionInfo().
if (empty($connection_options['namespace'
])) { $connection_options['namespace'
] =
(new \
ReflectionObject($this))->
getNamespaceName();
} $this->connection =
$connection;
$this->connectionOptions =
$connection_options;
} /**
* Opens a client connection.
*
* @param array $connection_options
* The database connection settings array.
*
* @return object
* A client connection object.
*/