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'); }
Please login to continue.