protected function ProjectServiceContainer::getFooBarService

Same name in this branch

Gets the 'foo_bar' service.

This service is shared. This method always returns the same instance of the service.

Return value

Object A %foo_class% instance.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php, line 104

Class

ProjectServiceContainer
ProjectServiceContainer

Code

protected function getFooBarService() {
  $class = $this
    ->getParameter('foo_class');
  return $this->services['foo_bar'] = new $class();
}