You are here

public function Connection::getDriverClass in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::getDriverClass()

Gets the driver-specific override class if any for the specified class.

Parameters

string $class: The class for which we want the potentially driver-specific class.

Return value

string The name of the class that should be used for this driver.

10 calls to Connection::getDriverClass()
Connection::delete in core/lib/Drupal/Core/Database/Connection.php
Prepares and returns a DELETE query object.
Connection::insert in core/lib/Drupal/Core/Database/Connection.php
Prepares and returns an INSERT query object.
Connection::merge in core/lib/Drupal/Core/Database/Connection.php
Prepares and returns a MERGE query object.
Connection::schema in core/lib/Drupal/Core/Database/Connection.php
Returns a DatabaseSchema object for manipulating the schema.
Connection::select in core/lib/Drupal/Core/Database/Connection.php
Prepares and returns a SELECT query object.

... See full list

File

core/lib/Drupal/Core/Database/Connection.php, line 759
Contains \Drupal\Core\Database\Connection.

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

public function getDriverClass($class) {
  if (empty($this->driverClasses[$class])) {
    $driver = $this
      ->driver();
    if (!empty($this->connectionOptions['namespace'])) {
      $driver_class = $this->connectionOptions['namespace'] . '\\' . $class;
    }
    else {

      // Fallback for Drupal 7 settings.php.
      $driver_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\{$class}";
    }
    $this->driverClasses[$class] = class_exists($driver_class) ? $driver_class : $class;
  }
  return $this->driverClasses[$class];
}