1
0
mirror of synced 2025-01-26 10:11:41 +03:00
2019-12-30 17:19:18 +03:00

56 lines
1.6 KiB
PHP

<?php
namespace RetailCrm\DeliveryModuleBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
protected static $availableLocales = ['ru', 'en', 'es'];
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('retailcrm_delivery_module');
$rootNode
->arrayNode('module')
->scalarNode('integration_code')
->isRequired()
->end()
->arrayNode('locales')
->requiresAtLeastOneElement()
->useAttributeAsKey('locale')
->prototype('array')
->children()
->scalarNode('name')
->isRequired()
->end()
->scalarNode('logo')
->isRequired()
->end()
->end()
->end()
->scalarNode('countries')
->cannotBeEmpty()
->defaultValue(['ru'])
->end()
->cannotBeEmpty()
->end()
->scalarNode('module_manager_class')
->isRequired()
->end()
->scalarNode('delivery_order_class')
->isRequired()
->end()
;
return $treeBuilder;
}
}