You are here

public function ContainerBuilder::getDefinition in Zircon Profile 8

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

Gets a service definition.

Parameters

string $id The service identifier:

Return value

Definition A Definition instance

Throws

InvalidArgumentException if the service definition does not exist

2 calls to ContainerBuilder::getDefinition()
ContainerBuilder::findDefinition in vendor/symfony/dependency-injection/ContainerBuilder.php
Gets a service definition by id or alias.
ContainerBuilder::get in vendor/symfony/dependency-injection/ContainerBuilder.php
Gets a service.

File

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

Class

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

Namespace

Symfony\Component\DependencyInjection

Code

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