diff --git a/DependencyInjection/Factory/DoctrineDbalAdapterFactory.php b/DependencyInjection/Factory/DoctrineDbalAdapterFactory.php new file mode 100644 index 0000000..4182ca2 --- /dev/null +++ b/DependencyInjection/Factory/DoctrineDbalAdapterFactory.php @@ -0,0 +1,71 @@ +setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.doctrine_dbal')) + ->addArgument(new Reference($config['doctrine_dbal_id'])) + ->addArgument($config['table']); + + if (isset($config['columns'])) { + $definition->addArgument($config['columns']); + } + } + + /** + * Returns the key for the factory configuration + * + * @return string + */ + function getKey() + { + return 'doctrine_dbal'; + } + + /** + * Adds configuration nodes for the factory + * + * @param NodeDefinition $builder + */ + function addConfiguration(NodeDefinition $builder) + { + $builder + ->children() + ->scalarNode('doctrine_dbal_id')->isRequired()->cannotBeEmpty()->end() + ->scalarNode('table')->isRequired()->cannotBeEmpty()->end() + ->arrayNode('columns') + ->children() + ->scalarNode('key')->end() + ->scalarNode('content')->end() + ->scalarNode('mtime')->end() + ->scalarNode('checksum')->end() + ->end() + ->end() + ->end() + ; + } +} diff --git a/Resources/config/adapter_factories.xml b/Resources/config/adapter_factories.xml index b316e47..7ca0153 100644 --- a/Resources/config/adapter_factories.xml +++ b/Resources/config/adapter_factories.xml @@ -23,6 +23,9 @@ + + + @@ -48,4 +51,3 @@ - diff --git a/Resources/config/gaufrette.xml b/Resources/config/gaufrette.xml index 36ec7d5..422a8bf 100644 --- a/Resources/config/gaufrette.xml +++ b/Resources/config/gaufrette.xml @@ -23,6 +23,7 @@ + @@ -48,4 +49,3 @@ -