Database::setActiveConnection

final public static Database::setActiveConnection($key = 'default')

Sets the active connection to the specified key.

Return value

string|null The previous database connection key.

File

core/lib/Drupal/Core/Database/Database.php, line 191

Class

Database
Primary front-controller for the database system.

Namespace

Drupal\Core\Database

Code

final public static function setActiveConnection($key = 'default') {
  if (!empty(self::$databaseInfo[$key])) {
    $old_key = self::$activeKey;
    self::$activeKey = $key;
    return $old_key;
  }
}
doc_Drupal
2016-10-29 08:59:33
Comments
Leave a Comment

Please login to continue.