2010-10-02 15:47:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
|
|
use Symfony\Component\DependencyInjection\Container;
|
2011-03-14 20:12:42 +00:00
|
|
|
use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;
|
2010-10-02 15:47:35 +01:00
|
|
|
use Symfony\Component\DependencyInjection\Reference;
|
|
|
|
use Symfony\Component\DependencyInjection\Parameter;
|
|
|
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ProjectServiceContainer
|
|
|
|
*
|
|
|
|
* This class has been auto-generated
|
|
|
|
* by the Symfony Dependency Injection Component.
|
|
|
|
*/
|
2011-01-17 10:40:04 +00:00
|
|
|
class ProjectServiceContainer extends Container
|
2010-10-02 15:47:35 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct(new ParameterBag($this->getDefaultParameters()));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-01-26 23:14:31 +00:00
|
|
|
* Gets the 'bar' service.
|
2010-10-02 15:47:35 +01:00
|
|
|
*
|
|
|
|
* This service is shared.
|
|
|
|
* This method always returns the same instance of the service.
|
|
|
|
*
|
2011-01-26 23:14:31 +00:00
|
|
|
* @return Object An instance returned by barFactory::createBarClass().
|
2010-10-02 15:47:35 +01:00
|
|
|
*/
|
2011-01-26 23:14:31 +00:00
|
|
|
protected function getBarService()
|
2010-10-02 15:47:35 +01:00
|
|
|
{
|
2011-03-22 13:22:19 +00:00
|
|
|
$this->services['bar'] = $instance = $this->get('barFactory')->createBarClass();
|
|
|
|
|
2011-02-27 20:14:03 +00:00
|
|
|
|
|
|
|
$this->applyInterfaceInjectors($instance);
|
2011-03-22 13:22:19 +00:00
|
|
|
|
|
|
|
return $instance;
|
2010-10-02 15:47:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-01-26 23:14:31 +00:00
|
|
|
* Gets the 'barfactory' service.
|
2010-10-02 15:47:35 +01:00
|
|
|
*
|
|
|
|
* This service is shared.
|
|
|
|
* This method always returns the same instance of the service.
|
|
|
|
*
|
2011-01-26 23:14:31 +00:00
|
|
|
* @return BarClassFactory A BarClassFactory instance.
|
2010-10-02 15:47:35 +01:00
|
|
|
*/
|
2011-01-26 23:14:31 +00:00
|
|
|
protected function getBarfactoryService()
|
2010-10-02 15:47:35 +01:00
|
|
|
{
|
2011-03-22 13:22:19 +00:00
|
|
|
$this->services['barfactory'] = $instance = new \BarClassFactory();
|
|
|
|
|
2011-02-27 20:14:03 +00:00
|
|
|
|
|
|
|
$this->applyInterfaceInjectors($instance);
|
2011-03-22 13:22:19 +00:00
|
|
|
|
|
|
|
return $instance;
|
2010-10-02 15:47:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Applies all known interface injection calls
|
|
|
|
*
|
|
|
|
* @param Object $instance
|
|
|
|
*/
|
2010-12-14 06:49:55 +00:00
|
|
|
protected function applyInterfaceInjectors($instance)
|
2010-10-02 15:47:35 +01:00
|
|
|
{
|
|
|
|
if ($instance instanceof \BarClass) {
|
|
|
|
$instance->setFoo('someValue');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|