code: public function buildForm(FormBuilderInterface $builder, array $options)
      {
          //prepare translation
          $entities = array();
          $customizableEntities = array(); //TODO : change name too close than $this->customizableEntities
          
          foreach($this->customizableEntities as $key => $definition) {
              $entities[$definition['class']] = $this->translator->trans($definition['name']);
              $customizableEntities[$definition['class']] = $definition;
          }
          
          $builder
              ->add('name', 'translatable_string')
              ->add('entity', 'choice', array(
                  'choices' => $entities
              ))
          ;
  
          $builder->addEventListener(FormEvents::POST_SET_DATA, 
                  function(FormEvent $event) use ($customizableEntities, $builder){
                      $form = $event->getForm();
                      $group = $event->getData();
                      
                      //stop the function if entity is not set
                      if ($group->getEntity() === NULL) {
                          return;
                      }
                      
                      if (count($customizableEntities[$group->getEntity()]['options']) > 0) {
                          $optionBuilder = $builder
                                  ->getFormFactory()
                                  ->createBuilderForProperty(
                                          'Chill\CustomFieldsBundle\Entity\CustomFieldsGroup', 
                                          'options'
                                          )
                                  ->create('options', null, array(
                                          'compound' => true, 
                                          'auto_initialize' => false,
                                          'required' => false)
                                      );
                      }
                      
                      foreach($customizableEntities[$group->getEntity()]['options'] as $key => $option) {
                                  $optionBuilder
                                      ->add($key, $option['form_type'], $option['form_options'])
                              ;
                      }
                      if (isset($optionBuilder) && $optionBuilder->count() > 0) {
                          $form->add($optionBuilder->getForm());
                      }
                      
                  });
      }
docs: TODO : details about the function