KnpGaufretteBundle/DependencyInjection/Factory/ServiceAdapterFactory.php

43 lines
880 B
PHP
Raw Permalink Normal View History

2011-05-08 21:04:37 +00:00
<?php
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory;
2011-05-08 21:04:37 +00:00
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Service adapter factory
*
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class ServiceAdapterFactory implements AdapterFactoryInterface
{
/**
* {@inheritDoc}
*/
public function create(ContainerBuilder $container, $id, array $config)
{
2011-05-13 05:11:59 +00:00
$container->setAlias($id, $config['id']);
2011-05-08 21:04:37 +00:00
}
/**
* {@inheritDoc}
*/
public function getKey()
{
return 'service';
}
/**
* {@inheritDoc}
*/
public function addConfiguration(NodeDefinition $builder)
{
$builder
->children()
->scalarNode('id')->isRequired()->end()
->end()
;
}
}