function Drupal::hasContainer

Same name and namespace in other branches
  1. 9 core/lib/Drupal.php \Drupal::hasContainer()
  2. 8.9.x core/lib/Drupal.php \Drupal::hasContainer()
  3. 10 core/lib/Drupal.php \Drupal::hasContainer()

Returns TRUE if the container has been initialized, FALSE otherwise.

Return value

bool TRUE if the container is initialized, FALSE otherwise.

16 calls to Drupal::hasContainer()
AccountProxyTest::testId in core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php
@covers ::id[[api-linebreak]] @covers ::setInitialAccountId[[api-linebreak]]
Database::getDriverList in core/lib/Drupal/Core/Database/Database.php
Returns the list provider for available database drivers.
DatabaseDriver::load in core/lib/Drupal/Core/Extension/DatabaseDriver.php
Loads the main extension file, if any.
DateFormatAccessControlHandlerTest::providerTestAccess in core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php
Provides test cases for access control based on user permissions and entity lock status.
Drupal::hasRequest in core/lib/Drupal.php
Indicates if there is a currently active request object.

... See full list

File

core/lib/Drupal.php, line 189

Class

Drupal
Static Service Container wrapper.

Code

public static function hasContainer() {
  return static::$container !== NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.