Symfony\Component\DependencyInjection\ContainerBuilder::get
Gets a service.
Signature
public function get(string
$id,
[integer
$invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE] )
Parameters
$id
—
string
- The service identifier
$invalidBehavior
—
integer
- The behavior when the service does not exist
Returns
- The associated service
Errors/Exceptions
-
InvalidArgumentException
- when no definitions are available
-
InactiveScopeException
- when the current scope is not active
-
LogicException
- when a circular dependency is detected
-
Exception
Parent Implementation