You are here

public function ContainerInterface::get in Zircon Profile 8

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

Gets a service.

Parameters

string $id The service identifier:

int $invalidBehavior The behavior when the service does not exist:

Return value

object The associated service

Throws

ServiceCircularReferenceException When a circular reference is detected

ServiceNotFoundException When the service is not defined

See also

Reference

3 methods override ContainerInterface::get()
Container::get in vendor/symfony/dependency-injection/Container.php
Gets a service.
Container::get in core/lib/Drupal/Component/DependencyInjection/Container.php
Gets a service.
ContainerBuilder::get in vendor/symfony/dependency-injection/ContainerBuilder.php
Gets a service.

File

vendor/symfony/dependency-injection/ContainerInterface.php, line 54

Class

ContainerInterface
ContainerInterface is the interface implemented by service container classes.

Namespace

Symfony\Component\DependencyInjection

Code

public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);