{@inheritdoc}

@param FormBuilderInterface $builder The form builder.
@param array                $options The form options.

@return void
493382
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        // Get the context and membership provider to pass into transformer.
        $context = $this->production_context;
        $provider = $this->membership_provider;

        $builder
            ->add('optional', null, [
                'label' => 'invitation.form.optional',
            ])
            ->add('invitee', ChoiceType::class, [
                'label' => 'invitation.form.invitee',
                'placeholder' => 'invitation.form.choose_invitee',
                'choice_translation_domain' => false,

                // Load all active memberships for a production as choices.
                'choice_loader' => new CallbackChoiceLoader(function () use ($context, $provider) {
                    foreach ($provider->loadActiveMembershipsByProduction($context->getContext()) as $membership) {
                        $member = $membership->getMember();
                        yield $member->__toString() => $member->getUsername();
                    }
                }),
            ])
        ;
    }
523226
protected function addParametersForm(FormBuilderInterface $builder, array $options, array $groups = []): void
    {
        /** @var \Netgen\BlockManager\Block\BlockDefinitionInterface $blockDefinition */
        $blockDefinition = $options['block']->getDefinition();

        $builder->add(
            'parameters',
            ParametersType::class,
            [
                'label' => false,
                'inherit_data' => true,
                'property_path' => 'parameterValues',
                'parameter_definitions' => $blockDefinition,
                'label_prefix' => 'block.' . $blockDefinition->getIdentifier(),
                'groups' => $groups,
            ]
        );
    }
1342419
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add(
                self::START_NAME,
                DateType::class,
                [
                    'widget' => 'single_text',
                    'attr' => [
                        'placeholder' => 'sidus.filter.date_range.start_date',
                    ],
                ]
            )
            ->add(
                self::END_NAME,
                DateType::class,
                [
                    'widget' => 'single_text',
                    'attr' => [
                        'placeholder' => 'sidus.filter.date_range.end_date',
                    ],
                ]
            );
    }
550003
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('x', NumberType::class, array())
            ->add('y', NumberType::class, array())
            ->add('width', NumberType::class, array())
            ->add('height', NumberType::class, array())
            ->add('rotate', NumberType::class, array())
            ->add('scaleX', NumberType::class, array())
            ->add('scaleY', NumberType::class, array())
        ;
    }
1101718
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $required = true;
        if ($options['data']->getId()) {
            $required = false;
        }
        $builder
            ->add('active', CheckboxType::class, array('label' => 'Aktiviert', 'required' => false))
            ->add('name', TextType::class, array('label' => 'Name'))
            ->add(
                'uploadedFile',
                FileType::class,
                array(
                    'label' => 'Upload',
                    'required' => $required,
                    'constraints' => array(
                        new File(array('maxSize' => "2M")),
                        //new Image(),
                    ),
                )
            );
    }
908413
public function buildForm(FormBuilderInterface &$builder, array $options, array $data)
    {
        $this->addStandardFormFields('contactsource', 'categories', $builder, $data);
        $this->addExtendedFormFields('contactsource', 'items', $builder, $data);
        //This is in anticipation of PR 5995 getting merged ~2.16
        if (method_exists($this, 'addCustomFormFields')) {
            $addCustomFormFields = 'addCustomFormFields';
            $this->$addCustomFormFields($this->getName(), 'export', $builder, 'mautic.core.permissions.export', ['disable' => 'mautic.core.permissions.disable'], $data);
        }
    }
1319059
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        $builder
            ->add('target_link', 'text', array(
                'required' => TRUE,
                'mapped' => FALSE,
                'error_bubbling' => TRUE,
                'constraints' => array(
                    new NotBlank(array('message' => 'fulgurio.lightcms.pages.add_form.target_link_is_required'))
                )
        ));
    }
196584
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->addModelTransformer(new CallbackTransformer(
            function ($original) {
                $tree = $this->blockService->getTree($original);

                return json_encode($tree);
            },
            function ($submitted) {
                $array = json_decode($submitted, true);

                $stripped = $this->stripMetadata($array);

                return trim(json_encode($stripped));
            }
        ));
    }
1210423
public function buildForm(FormBuilderInterface $builder, array $options)
	{
		$user_transformer = new StringToUserTransformer($this->userManager);
		$builder->addModelTransformer($user_transformer);
	}
907043
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($builder, $options) {
                if (empty($options['templates'])) {
                    return;
                }
                $event->getForm()->add('_template', ChoiceType::class, array(
                    'required' => true,
                    'choices' => $options['templates'],
                ));
            })
        ;
    }
116765
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->addIBAN($builder)
            ->addBIC($builder);

        if (Store::getInstance()->getCurrentCountry() === 'DE') {
            $this->addBankAccount($builder)
                ->addBankCode($builder)
                ->addBankCountry($builder, $options)
                ->addModeSwitch($builder, $options);
        }
    }
1044337
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('quantity', 'choice', array(
                'choices' => $this->product->getAddToCartQuantities(),
                'data'    => $this->quantity ? $this->quantity : 1,
            ))
        ;
    }
1167366
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        foreach ($options['supported_metadata'] as $metaName) {
            $builder->add($metaName, TextareaType::class, array(
                'required' => false,
            ));
        }
    }
287771
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('pageName', null, array(
            'label' => 'pages_controller_label_page_name',
        ));
        $builder->add('template', 'choice', array(
            'choices' => ChoiceValues::getTemplates($this->activeTheme, $this->themes),
            'label' => 'pages_controller_label_template',
        ));
        $builder->add('isHome', 'checkbox', array(
            'label' => 'pages_controller_label_home_page',
            'attr' => array(
                'title' => 'pages_controller_home_page_explanation',
            ),
        ));
        $builder->add('isPublished', 'checkbox', array(
            'label' => 'pages_controller_label_published',
        ));
    }
784596
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        $builder->get('value')->addModelTransformer(new StringToBooleanTransformer('1'));
    }
545511
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('day_of_week_numbers', 'choice', array(
                'choices'   => DayOfWeek::getChoices(),
                'multiple'  => true,
                'expanded'  => true,
                'label'     => 'Days of Week',
            ))
            ->add('start_time', 'choice', array(
                'choices'   => WindowMaker::getStartTimeChoices(),
            ))
            ->add('end_time', 'choice', array(
                'choices'   => WindowMaker::getEndTimeChoices(),
            ))
            ->add('delivery_type', 'choice', array(
                'choices' => array(
                  HubWindow::DELIVERY_TYPE_PICKUP   => 'Pickup',
                  HubWindow::DELIVERY_TYPE_DELIVERY => 'Delivery',
                ),
                'multiple'  => false,
                'expanded'  => true,
            ))
        ;
    }
327021
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $viewToIdTransformer = new ViewToIdTransformer($this->entityManager);

        $builder
            ->add($builder
                ->create('blog', HiddenType::class, ['label' => 'form.article.blog.label'])
                ->addModelTransformer($viewToIdTransformer))
            ->add('template')
            ->add('promoted', CheckboxType::class, [
                'label'    => 'form.article.type.promoted.label',
                'required' => false,
            ])
            ->add('tags', TagsType::class, [
                'required' => false,
                'multiple' => true,
            ])
            ->add('author', null, [
                'label'         => 'form.article.type.author.label',
                'required'      => true,
                'query_builder' => function (EntityRepository $er) {
                    return $er->createQueryBuilder('user')
                        ->where('user.roles LIKE :roles')
                        ->setParameter('roles', '%ROLE_VICTOIRE%');
                },
            ])
            ->remove('visibleOnFront');

        $builder->get('blog')->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
            $data = $event->getData();
            $parent = $event->getForm()->getParent();
            $this->manageCategories($data, $parent);
            $this->manageTemplate($data, $parent);
            $this->manageLocales($data, $parent);
        });

        $builder->get('blog')->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) {
            $data = $event->getData();
            $parent = $event->getForm()->getParent();
            $this->manageCategories($data, $parent);
            $this->manageLocales($data, $parent);
        });

        $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
            $data = $event->getData();
            $form = $event->getForm();
            $this->manageTags($data, $form);
        });
        $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) {
            $form = $event->getForm();
            $data = $form->getData();
            $this->manageTags($data, $form);
        });
    }