public function ContainerInterface::get

Gets a service.

@api

Parameters

string $id The service identifier:

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

Return value

object The associated service

Throws

InvalidArgumentException if the service is not defined

See also

Reference

1 method overrides ContainerInterface::get()
Container::get in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php
Gets a service.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php, line 57

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);