Database::isActiveConnection

final public static Database::isActiveConnection()

Determines if there is an active connection.

Note that this method will return FALSE if no connection has been established yet, even if one could be.

Return value

bool TRUE if there is at least one database connection established, FALSE otherwise.

File

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

Class

Database
Primary front-controller for the database system.

Namespace

Drupal\Core\Database

Code

final public static function isActiveConnection() {
  return !empty(self::$activeKey) && !empty(self::$connections) && !empty(self::$connections[self::$activeKey]);
}
doc_Drupal
2016-10-29 08:59:32
Comments
Leave a Comment

Please login to continue.