Update inline documentation.
This commit is contained in:
parent
02483aca83
commit
df1d1855a5
|
@ -1,35 +1,29 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Created by JetBrains PhpStorm.
|
|
||||||
* User: falk
|
|
||||||
* Date: 07.08.13
|
|
||||||
* Time: 14:25
|
|
||||||
* To change this template use File | Settings | File Templates.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory;
|
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory;
|
||||||
|
|
||||||
|
|
||||||
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
|
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\DependencyInjection\DefinitionDecorator;
|
use Symfony\Component\DependencyInjection\DefinitionDecorator;
|
||||||
use Symfony\Component\DependencyInjection\Reference;
|
use Symfony\Component\DependencyInjection\Reference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* doctrine dbal adapter factory
|
||||||
|
*
|
||||||
|
* @author Falk Doering <falk.doering@marktjagd.de>
|
||||||
|
*/
|
||||||
class DoctrineDbalAdapterFactory implements AdapterFactoryInterface
|
class DoctrineDbalAdapterFactory implements AdapterFactoryInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Creates the adapter, registers it and returns its id
|
* {@inheritDoc}
|
||||||
*
|
|
||||||
* @param ContainerBuilder $container A ContainerBuilder instance
|
|
||||||
* @param string $id The id of the service
|
|
||||||
* @param array $config An array of configuration
|
|
||||||
*/
|
*/
|
||||||
function create(ContainerBuilder $container, $id, array $config)
|
function create(ContainerBuilder $container, $id, array $config)
|
||||||
{
|
{
|
||||||
$definition = $container
|
$definition = $container
|
||||||
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.doctrine_dbal'))
|
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.doctrine_dbal'))
|
||||||
->addArgument(new Reference($config['doctrine_dbal_id']))
|
->addArgument(new Reference($config['doctrine_dbal_id']))
|
||||||
->addArgument($config['table']);
|
->addArgument($config['table'])
|
||||||
|
;
|
||||||
|
|
||||||
if (isset($config['columns'])) {
|
if (isset($config['columns'])) {
|
||||||
$definition->addArgument($config['columns']);
|
$definition->addArgument($config['columns']);
|
||||||
|
@ -37,9 +31,7 @@ class DoctrineDbalAdapterFactory implements AdapterFactoryInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the key for the factory configuration
|
* {@inheritDoc}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function getKey()
|
function getKey()
|
||||||
{
|
{
|
||||||
|
@ -47,9 +39,7 @@ class DoctrineDbalAdapterFactory implements AdapterFactoryInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds configuration nodes for the factory
|
* {@inheritDoc}
|
||||||
*
|
|
||||||
* @param NodeDefinition $builder
|
|
||||||
*/
|
*/
|
||||||
function addConfiguration(NodeDefinition $builder)
|
function addConfiguration(NodeDefinition $builder)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user