Appends form fields for "range" mode.

@param FormBuilderInterface $formBuilder

@return static
547280
protected function appendRangedFormFields(FormBuilderInterface $formBuilder)
    {
        // "From" options
        $fromDefaultOptions = [
            'label'    => 'da2e.filtration.number_filter.ranged.from.label',
            'required' => false,
        ];

        $fromUserOptions = array_key_exists('ranged_from', $this->getFormOptions())
            ? $this->getFormOptions()['ranged_from']
            : [];

        if (count($fromUserOptions) > 0) {
            $fromDefaultOptions = array_merge($fromDefaultOptions, $fromUserOptions);
        }

        $fromDefaultOptions['property_path'] = 'fromValue';

        // "To" options
        $toDefaultOptions = [
            'label'    => 'da2e.filtration.number_filter.ranged.to.label',
            'required' => false,
        ];

        $toUserOptions = array_key_exists('ranged_to', $this->getFormOptions())
            ? $this->getFormOptions()['ranged_to']
            : [];

        if (count($toUserOptions) > 0) {
            $toDefaultOptions = array_merge($toDefaultOptions, $toUserOptions);
        }

        $toDefaultOptions['property_path'] = 'toValue';

        $formBuilder->add($this->getFromValuePropertyName(), $this->getFormFieldTypeRangedFrom(), $fromDefaultOptions);
        $formBuilder->add($this->getToValuePropertyName(), $this->getFormFieldTypeRangedTo(), $toDefaultOptions);

        return $this;
    }
1125078
public function buildForm(FormBuilderInterface $builder, array $options)
	{
		$builder->add('title', TextType::class, array(
			'label' => 'Post title',
			'required' => true,
			'attr' => array('class' => 'doc-title')
		))
		->add('slug', TextType::class, array(
			'label' => 'Slug',
			'required' => true,
			'attr' => array('class' => 'doc-slug')
		))
		->add('state', ChoiceType::class, array(
			'label' => 'State',
			'required' => true,
			'choices' => array(
				'Draft' => DocumentModel::STATE_DRAFT, 
				'Waiting' => DocumentModel::STATE_WAITING, 
				'Published' => DocumentModel::STATE_PUBLISHED
			),
			'preferred_choices' => array(DocumentModel::STATE_DRAFT)
		))
		->add('content', TextareaType::class, array(
			'label' => 'Content',
			'required' => false,
			'attr' => array('class' => 'tinymce-content doc-content')
		));
	}
643930
protected function addBIC(FormBuilderInterface $builder)
    {
        $builder->add(
            self::FIELD_BIC,
            TextType::class,
            [
                'label' => false,
                'required' => true,
                'constraints' => [
                    $this->createManageMandateConstraint(),
                ],
            ]
        );

        return $this;
    }
1016951
protected function buildDataForm(FormBuilderInterface $builder)
    {
        $builder->addEventListener(
            FormEvents::PRE_SET_DATA,
            function (FormEvent $event) {
                $form = $event->getForm();
                /** @var User $user */
                $user = $event->getData();

                $dataOptions = [
                    'label' => false,
                    'widget_form_group_attr' => false,
                    'horizontal_input_wrapper_class' => false,
                    'family' => 'User',
                ];

                if (!$user->getData()) {
                    $dataOptions['data'] = $this->familyRegistry->getFamily('User')->createData();
                }
                /** @var FormBuilderInterface $infoTab */
                $infoTab = $form->get('__tab_info');
                $infoTab->add('data', DataType::class, $dataOptions);
            }
        );
    }
971538
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('richs', CollectionType::class, [
            'entry_type' => WidgetRichListItemType::class,
            'allow_add' => true,
            'allow_delete' => true,
            'by_reference' => false,
            'entry_options' => [
                'namespace'        => $options['namespace'],
                'businessEntityId' => $options['businessEntityId'],
                'widget'           => $options['widget'],
            ],
            'attr' => ['id' => 'static'],
        ]);

        //add the mode to the form
        $builder->add('mode', HiddenType::class, [
            'data' => $options['mode'],
        ]);

        //add the slot to the form
        $builder->add('slot', HiddenType::class, []);
        $this->addCriteriasFields($builder, $options);

        $builder->add('quantum', QuantumType::class, [
            'label'    => 'victoire.widget.type.quantum.label',
            'attr'     => [
                'data-flag' => 'v-quantum-name',
            ],
        ]);
    }
309962
public function adaptForm(FormBuilderInterface $formBuilder, ArrayObject $fields, $sequence)
    {
        $sfsf = new StringFormSubmissionField();
        $sfsf->setFieldName('field_' . $this->getUniqueId());
        $sfsf->setLabel($this->getLabel());
        $sfsf->setSequence($sequence);

        $data = $formBuilder->getData();
        $data['formwidget_' . $this->getUniqueId()] = $sfsf;

        $constraints = array();
        if ($this->getRequired()) {
            $options = array();
            if (!empty($this->errorMessageRequired)) {
                $options['message'] = $this->errorMessageRequired;
            }
            $constraints[] = new NotBlank($options);
        }
        if ($this->getRegex()) {
            $options = array('pattern' => $this->getRegex());
            if (!empty($this->errorMessageRegex)) {
                $options['message'] = $this->errorMessageRegex;
            }
            $constraints[] = new Regex($options);
        }

        $formBuilder->add('formwidget_' . $this->getUniqueId(),
            StringFormSubmissionType::class,
            array(
                'label' => $this->getLabel(),
                'constraints' => $constraints,
                'required' => $this->getRequired(),
            )
        );
        $formBuilder->setData($data);

        $fields->append($sfsf);
    }
229455
private function appendFields(QueryBuilder $builder, array $fields)
    {
        list($fields, $include) = $this->prepareFields($fields);
        if (!empty($fields)) {
            $method = (true === $include) ? 'select' : 'exclude';
            $builder->$method(array_keys($fields));
        }
        return $this;
    }
1110489
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $new      = !empty($options['data']) && $options['data']->getAlias() ? false : true;

        // change default option to "extendedField" from "lead" when plugin is enabled and config set
        $disallowLead = $this->coreParameters->getParameter('disable_lead_table_fields', false);
        if ($disallowLead && $new) {
            $options['data']->setObject('extendedField');
        }
        $disabled = !empty($options['data']) ? $options['data']->isFixed() : false;

        $builder->add(
            'object',
            'choice',
            [
                'choices'           => [
                    'mautic.lead.contact'             => 'lead',
                    'mautic.company.company'          => 'company',
                    'mautic.lead.extendedField'       => 'extendedField',
                    'mautic.lead.extendedFieldSecure' => 'extendedFieldSecure',
                ],
                'choices_as_values' => true,
                'choice_attr'       => function ($key, $val, $index) use ($disallowLead) {
                    // set "Contact" option disabled to true based on key or index of the choice.
                    if ('lead' === $key && $disallowLead) {
                        return ['disabled' => 'disabled'];
                    } else {
                        return [];
                    }
                },
                'expanded'          => false,
                'multiple'          => false,
                'label'             => 'mautic.lead.field.object',
                'empty_value'       => false,
                'attr'              => [
                    'class' => 'form-control',
                ],
                'required'          => false,
                'disabled'          => ($disabled || !$new),
                'data'              => $options['data']->getObject(),
            ]
        );

        // Add a bunch more 'custom' groups beside the original 4
        $builder->add(
            'group',
            'choice',
            [
                'choices' => [
                    'core'         => 'mautic.lead.field.group.core', // Personally Identifiable
                    'auto'         => 'mautic.lead.field.group.auto',
                    'client'       => 'mautic.lead.field.group.client',
                    'consent'      => 'mautic.lead.field.group.consent',
                    'education'    => 'mautic.lead.field.group.education',
                    'enhancement'  => 'mautic.lead.field.group.enhancement',
                    'finance'      => 'mautic.lead.field.group.finance',
                    'personal'     => 'mautic.lead.field.group.personal', // Health
                    'home'         => 'mautic.lead.field.group.home',
                    'politics'     => 'mautic.lead.field.group.politics',
                    'professional' => 'mautic.lead.field.group.professional',
                    'social'       => 'mautic.lead.field.group.social',
                    'system'       => 'mautic.lead.field.group.system',
                ],
                'attr' => [
                    'class'   => 'form-control',
                    'tooltip' => 'mautic.lead.field.form.group.help',
                ],
                'expanded'    => false,
                'multiple'    => false,
                'label'       => 'mautic.lead.field.group',
                'empty_value' => false,
                'required'    => false,
                'disabled'    => $disabled,
            ]
        );
    }
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,
            ))
        ;
    }
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',
                    ],
                ]
            );
    }
1188324
public function handle(FormBuilder $formBuilder)
    {
        $grid      = $formBuilder->grid;
        $fieldsets = $grid->fieldsets();
        if (empty($fieldsets)) {
            return false;
        }
        if (!isset($grid->name) or is_null($grid->name)) {
            return false;
        }

        $extension = app('antares.extension')->getActualExtension();
        $memory    = app('antares.memory')->make('registry');
        $namespace = $extension . '.' . $grid->name;
        if (is_null($memory->get($namespace))) {
            $memory->push($namespace, $namespace);
            $memory->finish();
            return false;
        }

        /* @var $formHandler FormHandler */
        $formHandler = app('Antares\Customfields\Events\FormHandler');
        $formHandler->onViewForm($grid->row(), $formBuilder, $namespace);
    }
833907
public function mapFieldForm(
        FormBuilderInterface $formBuilder,
        \EzSystems\EzPlatformAdminUi\UserSetting\ValueDefinitionInterface $value
    ): FormBuilderInterface {
        return $this->subitemsLimit->mapFieldForm($formBuilder, $value);
    }
1079405
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $format = $options['format'];

        $builder->addViewTransformer(
            new DateTimeToStringTransformer($options['date_timezone'], $options['user_timezone'], $format)
        );

        if ('string' === $options['input']) {
            $builder->addModelTransformer(new ReversedTransformer(
                new DateTimeToStringTransformer($options['date_timezone'], $options['date_timezone'], $format)
            ));
        } elseif ('timestamp' === $options['input']) {
            $builder->addModelTransformer(new ReversedTransformer(
                new DateTimeToTimestampTransformer($options['date_timezone'], $options['date_timezone'])
            ));
        } elseif ('array' === $options['input']) {
            $builder->addModelTransformer(new ReversedTransformer(
                new DateTimeToArrayTransformer($options['date_timezone'], $options['date_timezone'], array('year', 'month', 'day'))
            ));
        }
    }
257723
public function buildContentFieldValue(FormBuilderInterface $builder, FieldInterface $field)
    {
        $builder->add('value', $this->getFormFieldType(), array_merge(
            $this->getDefaultFormFieldValueOptions($field),
            $this->getFormFieldValueOptions($field)
        ));

        $modelTransformer = $this->getValueModelTransformer($field);
        if ($modelTransformer !== null) {
            $builder->get('value')
                ->addModelTransformer($modelTransformer);
        }
    }
345347
protected function addLabel(FormBuilderInterface $builder)
    {
        $builder->add(
            self::FIELD_PAYMENT_METHOD,
            HiddenType::class,
            [
                'label' => false,
                'required' => false,
                'data' => [],
            ]
        );

        return $this;
    }
498972
public function buildForm(FormBuilderInterface $builder): FormInterface
    {
        $this->buildFilterActions($builder);
        $this->buildDataGridActions($builder);

        $this->form = $this->getQueryHandler()->buildForm($builder);

        return $this->form;
    }
743314
protected function addNameOnCard(FormBuilderInterface $builder)
    {
        $builder->add(
            self::FIELD_NAME_ON_CARD,
            TextType::class,
            [
                'label' => false,
                'required' => true,
                'constraints' => [
                    $this->createNotBlankConstraint(),
                ],
            ]
        );

        return $this;
    }