function Drupal::database
Returns the current primary database.
Return value
\Drupal\Core\Database\Connection The current active database's master connection.
13 calls to Drupal::database()
- batch_process in core/
includes/ form.inc - Processes the batch.
- callback_batch_operation in core/
lib/ Drupal/ Core/ Form/ form.api.php - Perform a single batch operation.
- DblogHooks::cron in core/
modules/ dblog/ src/ Hook/ DblogHooks.php - Implements hook_cron().
- hook_entity_predelete in core/
lib/ Drupal/ Core/ Entity/ entity.api.php - Act before entity deletion.
- hook_ENTITY_TYPE_predelete in core/
lib/ Drupal/ Core/ Entity/ entity.api.php - Act before entity deletion of a particular entity type.
File
-
core/
lib/ Drupal.php, line 324
Class
- Drupal
- Static Service Container wrapper.
Code
public static function database() {
return static::getContainer()->get('database');
}