Drupal::database

public static Drupal::database()

Returns the current primary database.

Return value

\Drupal\Core\Database\Connection The current active database's master connection.

File

core/lib/Drupal.php, line 282
Contains \Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function database() {
  return static::getContainer()->get('database');
}
doc_Drupal
2016-10-29 09:02:44
Comments
Leave a Comment

Please login to continue.