KnpGaufretteBundle/DependencyInjection/Factory/DropboxAdapterFactory.php

46 lines
1.0 KiB
PHP
Raw Permalink Normal View History

2013-10-04 06:17:52 +00:00
<?php
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
/**
* Dropbox Adapter Factory
*/
class DropboxAdapterFactory implements AdapterFactoryInterface
{
/**
* {@inheritDoc}
*/
function create(ContainerBuilder $container, $id, array $config)
{
$container
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.dropbox'))
->addArgument(new Reference($config['api_id']))
;
}
/**
* {@inheritDoc}
*/
function getKey()
{
return 'dropbox';
}
/**
* {@inheritDoc}
*/
function addConfiguration(NodeDefinition $builder)
{
$builder
->children()
2013-10-06 06:25:51 +00:00
->scalarNode('api_id')->cannotBeEmpty()->end()
2013-10-04 06:17:52 +00:00
->end()
;
}
}