You are here

public function Container::initialized in Service Container 7

Same name in this branch
  1. 7 lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container::initialized()
  2. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Container.php \Symfony\Component\DependencyInjection\Container::initialized()
Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Container.php \Symfony\Component\DependencyInjection\Container::initialized()

Returns true if the given service has actually been initialized.

Parameters

string $id The service identifier:

Return value

bool true if service has already been initialized, false otherwise

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Container.php, line 355

Class

Container
Container is a dependency injection container.

Namespace

Symfony\Component\DependencyInjection

Code

public function initialized($id) {
  $id = strtolower($id);
  if ('service_container' === $id) {

    // BC: 'service_container' was a synthetic service previously.
    // @todo Change to false in next major release.
    return true;
  }
  if (isset($this->aliases[$id])) {
    $id = $this->aliases[$id];
  }
  return isset($this->services[$id]) || array_key_exists($id, $this->services);
}