public static function Drupal::database in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal.php \Drupal::database()
Returns the current primary database.
Return value
\Drupal\Core\Database\Connection The current active database's master connection.
35 calls to Drupal::database()
- BasicSyntaxTest::testGetFullQualifiedTableName in core/
tests/ Drupal/ KernelTests/ Core/ Database/ BasicSyntaxTest.php - Tests \Drupal\Core\Database\Connection::getFullQualifiedTableName().
- Breadcrumb404Test::getBreadcrumbCacheEntries in core/
tests/ Drupal/ FunctionalTests/ Breadcrumb/ Breadcrumb404Test.php - Gets the breadcrumb cache entries.
- callback_batch_operation in core/
lib/ Drupal/ Core/ Form/ form.api.php - Perform a single batch operation.
- dblog_cron in core/
modules/ dblog/ dblog.module - Implements hook_cron().
- drupal-7.contact.database.php in core/
modules/ contact/ tests/ drupal-7.contact.database.php
File
- core/
lib/ Drupal.php, line 323
Class
- Drupal
- Static Service Container wrapper.
Code
public static function database() {
return static::getContainer()
->get('database');
}