public function ContainerBuilder::getDefinition in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php \Symfony\Component\DependencyInjection\ContainerBuilder::getDefinition()
Gets a service definition.
@api
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 modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ ContainerBuilder.php - Gets a service definition by id or alias.
- ContainerBuilder::get in modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ ContainerBuilder.php - Gets a service.
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ ContainerBuilder.php, line 863
Class
- ContainerBuilder
- ContainerBuilder is a DI container that provides an API to easily describe services.
Namespace
Symfony\Component\DependencyInjectionCode
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];
}