You are here

public static function Drupal::hasContainer in Drupal 10

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

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

Return value

bool

6 calls to Drupal::hasContainer()
AccountProxyTest::testId in core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php
@covers ::id @covers ::setInitialAccountId
DependencySerializationTrait::__wakeup in core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php
Drupal::hasRequest in core/lib/Drupal.php
Indicates if there is a currently active request object.
Drupal::hasService in core/lib/Drupal.php
Indicates if a service is defined in the container.
SqlTest::setupEntityTypeManager in core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
Sets up the entity type manager in the container.

... See full list

File

core/lib/Drupal.php, line 169

Class

Drupal
Static Service Container wrapper.

Code

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