@param  ArgumentInterface      $argument
@param  SfFormBuilderInterface $builder
@param  mixed                  $defaultValue
@return void

Add the needed field(s) into the symfony form builder for the given argument
778901
public function addField(ArgumentInterface $argument, SfFormBuilderInterface $builder, $defaultValue = null)
    {
        if ($argument instanceof FormBuilderInterface) {
            $argument->buildForm($builder);
        } else {
            $argumentLabel = $this->formatTitle($argument->getName());

            if ($argument instanceof VectorArgumentInterface) {
                if (0 === preg_match("/^Vector\<([a-z_\-\.]+)\>$/", $argument->getType(), $match)) {
                    throw new InvalidTypeException(sprintf("Invalid vector type '%s'", $argument->getType()));
                }

                $subType = $this->typeResolver->transform($match[1]);

                if (null === $subType) {
                    throw new InvalidTypeException(sprintf("Invalid vector subtype '%s'", $match[1]));
                }

                $type = "collection";
                $options = [
                    "type" => $subType,
                    "allow_add" => true,
                    "allow_delete" => true,
                    "cascade_validation" => true,
                    "options" => [
                        "label" => $argumentLabel,
                        "required" => false,
                    ],
                ];
            } else {
                $type = $this->typeResolver->transform($argument->getType());

                if (null === $type) {
                    throw new InvalidTypeException(sprintf("Invalid argument type '%s'", $type));
                }

                $options = [
                    "label" => $argumentLabel,
                    "required" => false,
                ];

                if ($argument instanceof EnumArgument) {
                    $options["choices"] = $argument->getChoices();
                }

                if ($argument instanceof FloatArgument) {
                    $options["attr"]["step"] = 0.01;
                }
            }

            $currentValue = $argument->getValue();

            if (null !== $currentValue && "" !== $currentValue && [] !== $currentValue) {
                $options["data"] = $currentValue;
            } elseif (null !== $defaultValue) {
                $options["data"] = $defaultValue;
            }

            $builder->add($argument->getName(), $type, $options);
        }
    }
198279
protected function Value($fieldName, $defaultValue) {
        $form = Form::Current();
        if (!$form) {
            return $defaultValue;
        }
        return $form->GetValue($fieldName, $defaultValue);
    }
436007
private function buildFields($defaultFieldsValue) {
        $rawFields = $this->getRequest()->get('fields', null, $defaultFieldsValue);
        $fields = explode(',', $rawFields);
        $helper = new SplitHelper('.');
        $keyedFields = array_fill_keys($fields, null);
        $this->setField(new Field($helper->convert($keyedFields)));
    }
158954
public function serializeFieldDefaultValue(Generator $generator, $fieldTypeIdentifier, $defaultValue)
    {
        $this->serializeValue(
            'defaultValue',
            $generator,
            $this->getFieldType($fieldTypeIdentifier),
            $defaultValue
        );
    }
403419
public function setDefaultValue($defaultValue)
    {
        if (is_numeric($defaultValue)) {
            $this->defaultValue = $defaultValue;
        } else {
            $msg = "The 'defaultValue' argument must be a numeric value, '" . gettype($defaultValue) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
846973
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        $form_options = $builder->get('value')->getOptions();
        if ($form_options['multiple']) {
            $builder->get('value')->addModelTransformer(new StringToArrayTransformer(','));
        }
    }
1338003
public function argumentModeOptional($name, $description, $defaultValue = null)
    {
        $mode = InputArgument::OPTIONAL;
        return [$name, $mode, $description, $defaultValue];
    }
1268536
public static function setSimpleFloatFields(
        array $fields,
        ClassMetadataBuilder $builder,
        $default = null
    ): void {
        if (null !== $default && !\is_float($default)) {
            throw new \InvalidArgumentException(
                'Invalid default value ' . $default
                . ' with type ' . self::getType($default)
            );
        }
        foreach ($fields as $field) {
            $fieldBuilder = new FieldBuilder(
                $builder,
                [
                    'fieldName' => $field,
                    'type'      => Type::FLOAT,
                    'default'   => $default,
                ]
            );
            $fieldBuilder
                ->columnName(self::getColumnNameForField($field))
                ->nullable(null === $default)
                ->build();
        }
    }
947462
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        //====================================================================//
        // Dispatch Object Listing Event
        $this->getEventDispatcher()->dispatch(FormListingEvent::NAME, new FormListingEvent($builder, $options));
    }
827065
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        /**
         * @var Plugin $plugin
         */
        $plugin = $options['plugin'];
        foreach ($plugin->getFields() as $fieldName => $field) {
            $builder
                ->remove($fieldName)
                ->add($fieldName, $field['type'], array_merge([
                    'label' => $field['label'],
                    'data' => $field['data'],
                    'required' => $field['required'],
                    'attr' => $field['attr'],
                ], $field['options']), $field);
        }

        $builder->add('save', 'submit');
    }
316266
public function setDefaultValue(QtiDatatype $defaultValue = null)
    {
        if (Utils::isBaseTypeCompliant($this->getBaseType(), $defaultValue) && Utils::isCardinalityCompliant($this->getCardinality(), $defaultValue)) {
            $this->defaultValue = $defaultValue;

            return;
        } else {
            Utils::throwBaseTypeTypingError($this->getBaseType(), $defaultValue);
        }
    }
802039
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->buildValuesForm($builder, $options);
        $this->buildDataForm($builder, $options);

        $builder->addEventListener(
            FormEvents::POST_SUBMIT,
            function (FormEvent $event) {
                $data = $event->getData();
                if ($data instanceof DataInterface) {
                    $data->setUpdatedAt(new \DateTime());
                }
            }
        );
    }
409717
protected function buildResetAction(FormBuilderInterface $builder): void
    {
        $action = $builder->getOption('action');
        $defaults = [
            'form_type' => LinkType::class,
            'label' => 'sidus.datagrid.reset.label',
            'uri' => $action ?: '?',
        ];
        $options = array_merge($defaults, $this->getResetButton());
        $type = $options['form_type'];
        unset($options['form_type']);
        $builder->add('filterResetButton', $type, $options);
    }
784596
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        $builder->get('value')->addModelTransformer(new StringToBooleanTransformer('1'));
    }
1135345
public function setDefaultValue($value)
    {
        if (($value instanceof ValueGenerator) === false) {
            $value = new ValueGenerator($value);
        }

        if ($this->isValidParameterDefaultValue($value) !== true) {
            throw new InvalidArgumentException('Parameter default value is not valid.');
        }

        $this->defaultValue = $value;

        return $this;
    }
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);
        }
    }
851147
protected function defaultValueFrom(FormInterface $form)
    {
        $defaultValue = $form->getData();
        if (is_array($defaultValue)) {
            $defaultValue = implode(',', $defaultValue);
        }

        return $defaultValue;
    }