<?php
namespace WAM\Bundle\FormBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
const BASE_FIELD_ENTITY = 'WAM\Bundle\FormBundle\Entity\Field';
const HUBSPOT_FORM_TYPE = 'hubspot_type';
const PARDOT_FORM_TYPE = 'pardot_type';
const CUSTOM_FORM_TYPE = 'custom_type';
const MC_FORM_TYPE = 'marketingcloud_type';
const HUBSPOT_FORM_NAME = 'Formulario de hubspot';
const PARDOT_FORM_NAME = 'Formulario de Pardot';
const CUSTOM_FORM_NAME = 'Formulario custom';
const MC_FORM_NAME = 'Formulario de Marketing Cloud';
const HUBSPOT_FORM_ENABLED = true;
const PARDOT_FORM_ENABLED = true;
const CUSTOM_FORM_ENABLED = true;
const MC_FORM_ENABLED = true;
const HUBSPOT_FORM_COMPOUND = true;
const PARDOT_FORM_COMPOUND = false;
const CUSTOM_FORM_COMPOUND = true;
const MC_FORM_COMPOUND = true;
const HUBSPOT_FORM_HANDLER = 'wam_form.hubspot.handler';
const CUSTOM_FORM_HANDLER = 'wam_form.custom.handler';
const MC_FORM_HANDLER = 'wam_form.marketing_cloud.handler';
const BASE_CONTROLLER = 'wam_form.form.controller:renderFormAction';
const CUSTOM_FORM_EMAIL_FROM = 'no-reply@wearemarketing.com';
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder->root('wam_form')
->children()
->scalarNode('class')->defaultValue(self::BASE_FIELD_ENTITY)->end()
->scalarNode('controller')->defaultValue(self::BASE_CONTROLLER)->end()
->scalarNode('email_from')->defaultValue(self::CUSTOM_FORM_EMAIL_FROM)->end()
->arrayNode('custom_fields')
->defaultValue([])
->prototype('scalar')->end()
->end()
->arrayNode('form_types')
->arrayPrototype()
->children()
->booleanNode('enabled')->defaultTrue()->end()
->scalarNode('name')->cannotBeEmpty()->end()
->scalarNode('compound')->cannotBeEmpty()->end()
->scalarNode('handler')->end()
->end()
->end()
->end()
->arrayNode('thankyou_templates')
->useAttributeAsKey('template')
->defaultValue([])
->prototype('scalar')
->end()
->end()
->end();
return $treeBuilder;
}
}