setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.amazon_s3')) ->addArgument(new Reference($config['amazon_s3_id'])) ->addArgument($config['bucket_name']); if (isset($config['options'])) { $definition->addArgument($config['options']); } } /** * Returns the key for the factory configuration * * @return string */ public function getKey() { return 'amazon_s3'; } /** * Adds configuration nodes for the factory * * @param NodeBuilder $builder */ public function addConfiguration(NodeDefinition $builder) { $builder ->children() ->scalarNode('amazon_s3_id')->isRequired()->cannotBeEmpty()->end() ->scalarNode('bucket_name')->isRequired()->cannotBeEmpty()->end() ->arrayNode('options') ->children() ->booleanNode('create') ->defaultFalse() ->end() ->scalarNode('region')->end() ->scalarNode('directory')->end() ->end() ->end() ->end() ; } }