You are here

public function ContainerBuilder::findDefinition in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/ContainerBuilder.php \Symfony\Component\DependencyInjection\ContainerBuilder::findDefinition()

Gets a service definition by id or alias.

The method "unaliases" recursively to return a Definition instance.

Parameters

string $id The service identifier or alias:

Return value

Definition A Definition instance

Throws

InvalidArgumentException if the service definition does not exist

File

vendor/symfony/dependency-injection/ContainerBuilder.php, line 813

Class

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

Namespace

Symfony\Component\DependencyInjection

Code

public function findDefinition($id) {
  $id = strtolower($id);
  while (isset($this->aliasDefinitions[$id])) {
    $id = (string) $this->aliasDefinitions[$id];
  }
  return $this
    ->getDefinition($id);
}