public function ContainerBuilder::getAlias

Gets an alias.

@api

Parameters

string $id The service identifier:

Return value

Alias An Alias instance

Throws

InvalidArgumentException if the alias does not exist

1 call to ContainerBuilder::getAlias()
ContainerBuilder::findDefinition in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php
Gets a service definition by id or alias.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php, line 752

Class

ContainerBuilder
ContainerBuilder is a DI container that provides an API to easily describe services.

Namespace

Symfony\Component\DependencyInjection

Code

public function getAlias($id) {
  $id = strtolower($id);
  if (!$this
    ->hasAlias($id)) {
    throw new InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $id));
  }
  return $this->aliasDefinitions[$id];
}