vendor/wearemarketing/formbundle/DependencyInjection/Configuration.php line 46

Open in your IDE?
  1. <?php
  2. namespace WAM\Bundle\FormBundle\DependencyInjection;
  3. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  4. use Symfony\Component\Config\Definition\ConfigurationInterface;
  5. class Configuration implements ConfigurationInterface
  6. {
  7.     const BASE_FIELD_ENTITY 'WAM\Bundle\FormBundle\Entity\Field';
  8.     const HUBSPOT_FORM_TYPE 'hubspot_type';
  9.     const PARDOT_FORM_TYPE 'pardot_type';
  10.     const CUSTOM_FORM_TYPE 'custom_type';
  11.     const MC_FORM_TYPE 'marketingcloud_type';
  12.     const HUBSPOT_FORM_NAME 'Formulario de hubspot';
  13.     const PARDOT_FORM_NAME 'Formulario de Pardot';
  14.     const CUSTOM_FORM_NAME 'Formulario custom';
  15.     const MC_FORM_NAME 'Formulario de Marketing Cloud';
  16.     const HUBSPOT_FORM_ENABLED true;
  17.     const PARDOT_FORM_ENABLED true;
  18.     const CUSTOM_FORM_ENABLED true;
  19.     const MC_FORM_ENABLED true;
  20.     const HUBSPOT_FORM_COMPOUND true;
  21.     const PARDOT_FORM_COMPOUND false;
  22.     const CUSTOM_FORM_COMPOUND true;
  23.     const MC_FORM_COMPOUND true;
  24.     const HUBSPOT_FORM_HANDLER 'wam_form.hubspot.handler';
  25.     const CUSTOM_FORM_HANDLER 'wam_form.custom.handler';
  26.     const MC_FORM_HANDLER 'wam_form.marketing_cloud.handler';
  27.     const BASE_CONTROLLER 'wam_form.form.controller:renderFormAction';
  28.     const CUSTOM_FORM_EMAIL_FROM 'no-reply@wearemarketing.com';
  29.     /**
  30.      * {@inheritdoc}
  31.      */
  32.     public function getConfigTreeBuilder()
  33.     {
  34.         $treeBuilder = new TreeBuilder();
  35.         $treeBuilder->root('wam_form')
  36.             ->children()
  37.                 ->scalarNode('class')->defaultValue(self::BASE_FIELD_ENTITY)->end()
  38.                 ->scalarNode('controller')->defaultValue(self::BASE_CONTROLLER)->end()
  39.                 ->scalarNode('email_from')->defaultValue(self::CUSTOM_FORM_EMAIL_FROM)->end()
  40.                 ->arrayNode('custom_fields')
  41.                     ->defaultValue([])
  42.                     ->prototype('scalar')->end()
  43.                 ->end()
  44.                 ->arrayNode('form_types')
  45.                     ->arrayPrototype()
  46.                         ->children()
  47.                             ->booleanNode('enabled')->defaultTrue()->end()
  48.                             ->scalarNode('name')->cannotBeEmpty()->end()
  49.                             ->scalarNode('compound')->cannotBeEmpty()->end()
  50.                             ->scalarNode('handler')->end()
  51.                         ->end()
  52.                     ->end()
  53.                 ->end()
  54.                 ->arrayNode('thankyou_templates')
  55.                     ->useAttributeAsKey('template')
  56.                     ->defaultValue([])
  57.                     ->prototype('scalar')
  58.                 ->end()
  59.                 ->end()
  60.             ->end();
  61.         return $treeBuilder;
  62.     }
  63. }