W3cubDocs

/Drupal 8

public function Container::initialized

public Container::initialized($id)

Check for whether or not a service has been initialized.

Parameters

string $id:

Return value

bool true if the service has been initialized, false otherwise

Overrides IntrospectableContainerInterface::initialized

File

core/lib/Drupal/Component/DependencyInjection/Container.php, line 415

Class

Container
Provides a container optimized for Drupal's needs.

Namespace

Drupal\Component\DependencyInjection

Code

public function initialized($id) {
  if (isset($this->aliases[$id])) {
    $id = $this->aliases[$id];
  }

  return isset($this->services[$id]) || array_key_exists($id, $this->services);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!DependencyInjection!Container.php/function/Container::initialized/8.1.x