@param \Symfony\Component\Form\FormBuilderInterface $builder
@param array $options

@return void
484995
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->addOnlineBankTransferType($builder, $options)
            ->addBankCountry($builder, $options);
    }
190976
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->addModelTransformer($this)
            ->add('name', TextType::class)
            ->add('title', TextType::class)
            ->add('headline', TextareaType::class, array(
                'required' => false,
            ))
            ->add('externalLink', TextType::class, array(
                'required' => false,
            ))
            ->add('alt', TextType::class, array(
                'required' => false,
            ))
            ->add('tags', TextType::class, array(
                'required' => false,
            ))
        ;
    }
104750
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('expression', TextType::class, [
                'required' => true,
                'constraints' => [new ExpressionConstraint()],
            ])
            ->add('arguments', TextType::class, [
                'required' => false,
                'constraints' => [new ArgumentsConstraint()],
            ])
            ->add('priority', IntegerType::class, [
                'required' => true,
            ])
            ->add('enabled', CheckboxType::class, [
                'required' => false,
            ])
            ->add('update', SubmitType::class, [
                'label' => /** @Desc("Update") */
                    'cron_update_form.update',
            ]);
    }
959193
protected function doActionObject($method, ObjectBuilderInterface $builder, array $options): void
    {
        if (null !== $this->parent) {
            $this->parent->{$method}($builder, $options);
        }

        $this->innerType->{$method}($builder, $options);

        foreach ($this->typeExtensions as $extension) {
            /* @var ObjectTypeExtensionInterface $extension */
            $extension->{$method}($builder, $options);
        }
    }
359263
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $categories = $this->filterQueryHandler->handle($options['widget'], BlogCategory::class);

        //getAll categories
        $categoryQb = $this->getEntityManager()->getRepository('VictoireBlogBundle:BlogCategory')->getAll();
        //getAll published articles
        $articleQb = $this->getEntityManager()->getRepository('VictoireBlogBundle:Article')->getAll(true);

        //get Listing
        $listing = $options['widget']->getListing();

        $mode = $listing->getMode();
        switch ($mode) {
            case 'query':
                //filter with listingQuery
                $articleQb->filterWithListingQuery($listing->getQuery());
                break;
        }
        $categoryQb->filterByArticles($articleQb->getInstance('article'));
        $categories = $categoryQb->getInstance('c_category')->getQuery()->getResult();

        //the blank value
        $categoriesChoices = [];

        foreach ($categories as $category) {
            $categoriesChoices[$category->getTitle()] = $category->getId();
        }

        $data = null;
        if ($this->getRequest()->query->has('filter') && array_key_exists('category_filter', $this->getRequest()->query->get('filter'))) {
            if ($options['multiple']) {
                $data = [];
                foreach ($this->getRequest()->query->get('filter')['category_filter']['category'] as $id => $selectedCategory) {
                    $data[$id] = $selectedCategory;
                }
            } else {
                $data = $this->getRequest()->query->get('filter')['category_filter']['category'];
            }
        }

        $builder
            ->add(
                'category',
                ChoiceType::class,
                [
                    'label'       => false,
                    'choices'     => $categoriesChoices,
                    'required'    => false,
                    'expanded'    => true,
                    'multiple'    => $options['multiple'],
                    'placeholder' => $this->translator->trans('blog.category_filter.empty_value.label'),
                    'data'        => $data,
                ]
            );
    }
393268
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('containerTag', ChoiceType::class, [
                'label'          => 'widget_layout.form.containerTag.label',
                'vic_help_block' => 'widget_layout.form.containerTag.help_block',
                'choices'        => array_combine(Widget::$tags, Widget::$tags),
            ])
            ->add('containerClass', null, [
                'label'    => 'widget_layout.form.containerClass.label',
                'required' => false,
            ])
            ->add('vicActiveTab', HiddenType::class, [
                'required' => false,
                'mapped'   => false,
            ])
            ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
                /*
                 * Generate form fields for each part of form
                 * Example, generate Static content, XS and SM as color forms
                 * Whereas MD and LG are image forms
                 */
                foreach ($this->victoire_twig_responsive as $key) {
                    self::generateBackgroundFields($event->getForm(), $key, $event->getData()->{'getContainerBackgroundType'.$key}());
                }
            });

        foreach ($this->victoire_twig_responsive as $key) {
            /*
             * Build global fields for all parts of form
             */
            $builder
                ->add('containerMargin'.$key, null, [
                    'label'          => 'widget_layout.form.containerMargin'.$key.'.label',
                    'vic_help_block' => 'widget_layout.form.containerMargin.help_block',
                    'required'       => false,
                ])
                ->add('containerPadding'.$key, null, [
                    'label'          => 'widget_layout.form.containerPadding'.$key.'.label',
                    'vic_help_block' => 'widget_layout.form.containerPadding.help_block',
                    'required'       => false,
                ])
                ->add('containerWidth'.$key, null, [
                    'label' => 'widget_layout.form.containerWidth'.$key.'.label',
                    'attr'  => ['placeholder' => 'widget_layout.form.containerWidth.placeholder'],
                ])
                ->add('containerHeight'.$key, null, [
                    'label' => 'widget_layout.form.containerHeight'.$key.'.label',
                    'attr'  => ['placeholder' => 'widget_layout.form.containerWidth.placeholder'],
                ])
                ->add('textAlign'.$key, ChoiceType::class, [
                    'label'    => 'widget_layout.form.textAlign'.$key.'.label',
                    'required' => false,
                    'choices'  => [
                        'widget_layout.form.textAlign.choices.left.label'    => 'left',
                        'widget_layout.form.textAlign.choices.center.label'  => 'center',
                        'widget_layout.form.textAlign.choices.right.label'   => 'right',
                        'widget_layout.form.textAlign.choices.justify.label' => 'justify',
                    ],
                    'placeholder'       => 'widget_layout.form.textAlign.choices.placeholder',
                    'choices_as_values' => true,
                ])
                ->add('containerBackgroundType'.$key, ChoiceType::class, [
                    'label'    => 'widget_layout.form.containerBackgroundType'.$key.'.label',
                    'required' => false,
                    'choices'  => [
                        'widget_layout.form.containerBackgroundType.choices.color.label' => 'color',
                        'widget_layout.form.containerBackgroundType.choices.image.label' => 'image',
                    ],
                    'placeholder'       => 'widget_layout.form.containerBackgroundType.choices.placeholder',
                    'choices_as_values' => true,
                    'attr'              => [
                        'data-refreshOnChange' => 'true',
                    ],
                ])
                ->get('containerBackgroundType'.$key)->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($key) {
                    self::generateBackgroundFields($event->getForm()->getParent(), $key, $event->getData());
                });
        }

        // add theme field
        $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
            $data = $event->getData();
            $form = $event->getForm();
            //guess the bundle name
            $widgetBundle = self::getBundleNameFromEntity(get_class($data), $this->kernel->getBundles());
            //search for available theme files
            $finder = Finder::create()
                ->files()
                ->name('/^show(.)+\.html\.twig$/')
                ->in($this->fileLocator->locate('@'.$widgetBundle.'/Resources/views', null, false))
                ->sortByName();

            $choices = [];
            //prepare choices by adding in each theme
            foreach ($finder as $key => $file) {
                $theme = $file->getRelativePathname();
                $theme = preg_replace('/show|\.html\.twig/', '', $theme);
                $choices['victoire.'.$widgetBundle.'.theme.'.$theme.'.label'] = $theme;
            }
            //We add the theme type only if there is a choice
            if (count($choices)) {
                $form->add('theme', ChoiceType::class, [
                    'label'             => 'widget.form.theme.label',
                    'choices'           => $choices,
                    'choices_as_values' => true,
                    'placeholder'       => 'victoire.theme.default.label',
                ]);
            }
        });
    }
1210423
public function buildForm(FormBuilderInterface $builder, array $options)
	{
		$user_transformer = new StringToUserTransformer($this->userManager);
		$builder->addModelTransformer($user_transformer);
	}
69422
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('title', TextType::class, [
                'label'       => 'blog.form.title.label',
                'required'    => true,
                'constraints' => [
                    new \Symfony\Component\Validator\Constraints\NotBlank(),
                ],
                'attr' => [
                    'class' => 'vic-blogCategoryWidget-formControl',
                    ],
                ]
            )
            ->add('description', TextType::class, [
                'label'         => 'blog.form.description.label',
                'attr'          => [
                    'class'     => 'vic-blogCategoryWidget-formControl',
                ],
            ])
            ->remove('removeButton');

        /*
         * When we are editing a menu, we must add the sub menus if there are some children in the entity
         */
        $builder->addEventListener(
            FormEvents::PRE_SET_DATA,
            function (FormEvent $event) {
                $entity = $event->getData();

                if ($entity !== null) {
                    $nbChildren = count($entity->getChildren());

                    if ($nbChildren > 0) {
                        $form = $event->getForm();
                        $this->addChildrenField($form);
                    }
                }
            }
        );

        /*
         * we use the PRE_SUBMIT event to avoid having a circular reference
         *
         * This is done when a widget is created in js in the view
         */
        $builder->addEventListener(
            FormEvents::PRE_SUBMIT,
            function (FormEvent $event) {
                $rawData = $event->getData();
                if (isset($rawData['children'])) {
                    $addChildren = true;
                } else {
                    $addChildren = false;
                }

                //did some children was added in the form
                if ($addChildren) {
                    $form = $event->getForm();
                    $this->addChildrenField($form);
                }
            }
        );
    }
465677
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->dataTransformer->setReferenceClass($options['reference_class']);
        $this->dataTransformer->setInversedClass($options['inversed_class']);
        $this->dataTransformer->setInversedProperty($options['inversed_property']);
        
        $builder->addModelTransformer($this->dataTransformer);
    }
246242
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('idPage', 'hidden', array('label' => 'pages_controller_label_permalink'));
        $builder->add('idLanguage', 'choice', array('choices' => ChoiceValues::getLanguages($this->languageRepository)));
        $builder->add('permalink', 'textarea', array(
            'label' => 'pages_controller_label_permalink',
            'attr' => array(
                'rows' => '3',
            ),));
        $builder->add('title', 'textarea', array(
            'label' => 'pages_controller_label_meta_title',
            'attr' => array(
                'title' => 'pages_controller_meta_title_explanation',
                'rows' => '3',
            ),
        ));
        $builder->add('description', 'textarea', array(
            'label' => 'pages_controller_label_meta_description',
            'attr' => array(
                'title' => 'pages_controller_meta_description_explanation',
                'rows' => '3',
            ),
        ));
        $builder->add('keywords', 'textarea', array(
            'label' => 'pages_controller_label_meta_keywords',
            'attr' => array(
                'title' => 'pages_controller_meta_keywords_explanation',
                'rows' => '2',
            ),
        ));
        $builder->add('sitemapChangeFreq', 'choice', array(
            'choices' => array(
                '' => '-',
                'always' => 'always',
                'hourly' => 'hourly',
                'daily' => 'daily',
                'weekly' => 'weekly',
                'monthly' => 'monthly',
                'yearly' => 'yearly',
                'never' => 'never',
            ),
            'label' => 'pages_controller_label_change frequency',
        ));
        $builder->add('sitemapPriority', 'choice', array(
            'choices' => array(
                '0.0' => '0.0',
                '0.1' => '0.1',
                '0.2' => '0.2',
                '0.3' => '0.3',
                '0.4' => '0.4',
                '0.5' => '0.5',
                '0.6' => '0.6',
                '0.7' => '0.7',
                '0.8' => '0.8',
                '0.9' => '0.9',
                '1.0' => '1.0',
            ),
            'data' => '0.5',
            'label' => 'pages_controller_label_priority',
        ));
    }
1297364
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if (null !== $this->parent) {
            $this->parent->buildForm($builder, $options);
        }

        $this->innerType->buildForm($builder, $options);

        foreach ($this->typeExtensions as $extension) {
            $extension->buildForm($builder, $options);
        }
    }
439466
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        foreach ($options['button_groups'] as $name => $config) {
            $builder->add($name, ButtonGroupType::class, $config);
        }
    }
1105739
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $resource = $options['data'];
        $builder
            ->add('media', MediaType::class, [
                'label' => 'resource.form.file',
                'provider' => 'sonata.media.provider.file',
                'context' => 'default',
                'translation_domain' => BkstgResourceBundle::TRANSLATION_DOMAIN,
            ])
            ->add('name', TextType::class, [
                'label' => 'resource.form.name',
            ])
            ->add('description', CKEditorType::class, [
                'label' => 'resource.form.description',
                'config' => ['toolbar' => 'basic'],
                'required' => false,
            ])
            ->add('active', ChoiceType::class, [
                    // Show "unpublished" instead of active.
                    'choice_loader' => new CallbackChoiceLoader(function () use ($resource) {
                        yield 'resource.form.status_choices.active' => true;
                        if (!$resource->isPublished()) {
                            yield 'resource.form.status_choices.unpublished' => false;
                        } else {
                            yield 'resource.form.status_choices.archived' => false;
                        }
                    }),
                    'label' => 'resource.form.status',
            ])
            ->add('pinned', CheckboxType::class, [
                'label' => 'resource.form.pinned',
                'required' => false,
            ])
        ;
    }
510757
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add(
            'family',
            FamilySelectorType::class,
            [
                'label' => false,
                'families' => $options['allowed_families'],
                'placeholder' => 'sidus.family.selector.placeholder',
            ]
        );
        $builder->addEventListener(
            FormEvents::PRE_SET_DATA,
            function (FormEvent $event) use ($options) {
                $form = $event->getForm();
                /** @var DataInterface $data */
                $data = $event->getData();

                /** @var FamilyInterface[] $families */
                $families = $options['allowed_families'];
                foreach ($families as $family) {
                    $selected = false;
                    if ($data instanceof DataInterface) {
                        $selected = $family->getCode() === $data->getFamilyCode();
                    }
                    $form->add(
                        'data_'.$family->getCode(),
                        AutocompleteDataSelectorType::class,
                        [
                            'label' => false,
                            'allowed_families' => [$family],
                            'auto_init' => $selected,
                            'attr' => [
                                'data-family' => $family->getCode(),
                                'style' => 'display:none',
                            ],
                        ]
                    );
                }
            }
        );

        $builder->addModelTransformer(
            new CallbackTransformer(
                function ($originalData) {
                    if ($originalData instanceof DataInterface) {
                        return [
                            'family' => $originalData->getFamily(),
                            'data_'.$originalData->getFamilyCode() => $originalData,
                        ];
                    }

                    return $originalData;
                },
                function ($submittedData) {
                    $family = $submittedData['family'];
                    if ($family instanceof FamilyInterface) {
                        return $submittedData['data_'.$family->getCode()];
                    }

                    return null;
                }
            )
        );
    }
295834
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('start', null, [
                'label' => 'event.form.start',
                'date_widget' => 'single_text',
                'time_widget' => 'single_text',
            ])
            ->add('end', null, [
                'label' => 'event.form.end',
                'date_widget' => 'single_text',
                'time_widget' => 'single_text',
            ])
            ->add('name', null, [
                'label' => 'event.form.name',
            ])
            ->add('description', CKEditorType::class, [
                'label' => 'event.form.description',
                'required' => false,
                'config' => ['toolbar' => 'basic'],
            ])
            ->add('full_company', CheckboxType::class, [
                'label' => 'event.form.full_company',
                'required' => false,
            ])
            ->add('invitations', CollectionType::class, [
                'label' => 'event.form.invitations',
                'entry_type' => InvitationType::class,
                'entry_options' => ['label' => false],
                'allow_add' => true,
                'allow_delete' => true,
                'by_reference' => false,
            ])
        ;
    }
734336
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $pageHandler = $this;
        $builder
            ->add('model', 'choice', array(
                'choices'        => $this->models,
                'required'       => TRUE,
                'error_bubbling' => TRUE,
                'constraints'    => array(
                    new NotBlank(array('message' => 'fulgurio.lightcms.pages.add_form.model_is_required'))
                )
            ))
            ->add('title', 'text', array(
                'error_bubbling' => TRUE,
                'constraints'    => array(
                    new NotBlank(array('message' => 'fulgurio.lightcms.pages.add_form.title_is_required'))
                )
            ))
            ->add('parent', 'entity', array(
                'class'          => 'FulgurioLightCMSBundle:Page',
                'property'       => 'title',
                'error_bubbling' => TRUE,
                'query_builder'  => function(EntityRepository $er) {
                    return $er->createQueryBuilder('p')
                            ->orderBy('p.title', 'ASC');
                },
            ))
            ->add('fullpath', 'hidden')
            ->add('content', 'text')
            ->add('status', 'choice', array(
                'choices'         => $this->status,
                'required'        => TRUE,
                'error_bubbling'  => TRUE,
                'invalid_message' => 'fulgurio.lightcms.pages.add_form.status_is_required'
            ))
            ->add('meta_keywords', 'text', array(
                'required' => FALSE,
                'mapped'   => FALSE
            ))
            ->add('meta_description', 'text', array(
                'required' => FALSE,
                'mapped'   => FALSE
            ))
            ->add('sourceId', 'hidden')
            ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($pageHandler) {
                $form = $event->getForm();
                $title = $form->get('title');
                if (in_array(LightCMSUtils::makeSlug($title->getData()), $pageHandler->getSlugExclusions()))
                {
                    $title->addError(new FormError('fulgurio.lightcms.pages.add_form.title_is_not_allowed'));
                }
            })
        ;
        if (!empty($this->langs) && count($this->langs) > 1)
        {
            $builder->add('lang', 'choice', array(
                    'choices'        => $this->langs,
                    'required'       => TRUE,
                    'error_bubbling' => TRUE
                )
            );
        }
        if (!empty($this->menus))
        {
            $builder->add('availableMenu', 'choice', array(
                'choices'        => $this->menus,
                'multiple'       => TRUE,
                'required'       => FALSE,
                'error_bubbling' => TRUE
                )
            );
        }
    }
1167366
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        foreach ($options['supported_metadata'] as $metaName) {
            $builder->add($metaName, TextareaType::class, array(
                'required' => false,
            ));
        }
    }