Maps Field form to current FieldType based on the configured form type (self::$formType).

@param FormInterface $fieldForm Form for the current Field.
@param FieldData $data Underlying data for current Field form.
324277
public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data)
    {
        $fieldDefinition = $data->fieldDefinition;
        $formConfig = $fieldForm->getConfig();

        $fieldForm
            ->add(
                $formConfig->getFormFactory()->createBuilder()
                    ->create(
                        'value',
                        $this->formType,
                        [
                            'required' => $fieldDefinition->isRequired,
                            'label' => $fieldDefinition->getName(),
                        ]
                    )
                    ->addModelTransformer(new FieldValueTransformer($this->fieldTypeService->getFieldType($fieldDefinition->fieldTypeIdentifier)))
                    // Deactivate auto-initialize as we're not on the root form.
                    ->setAutoInitialize(false)
                    ->getForm()
            );
    }
937379
public function changeData(FormEvent $event)
    {
        $data = $event->getData();

        if (null === $data) {
            $data = array();
        }

        if ($data instanceof \Doctrine\Common\Collections\Collection) {
            $event->setData($data->getValues());
        } else {
            $event->setData(array_values($data));
        }
    }
669410
protected function createColumn(array $fieldData, string $fieldName): ColumnInterface
    {
        $fieldType = $fieldData[self::FIELD_TYPE];

        switch (true) {
            case key_exists($fieldType, $this->fieldClasses[self::COLUMN_SIMPLE]):
                $defaultFieldParameters = $this->parameters[self::COLUMN_SIMPLE];
                $columnClass = $this->fieldClasses[self::COLUMN_SIMPLE][$fieldType];
                break;
            case key_exists($fieldType, $this->fieldClasses[self::COLUMN_LENGTH]):
                $defaultFieldParameters = $this->parameters[self::COLUMN_LENGTH];
                $columnClass = $this->fieldClasses[self::COLUMN_LENGTH][$fieldType];
                break;
            case key_exists($fieldType, $this->fieldClasses[self::COLUMN_PRECISION]):
                $defaultFieldParameters = $this->parameters[self::COLUMN_PRECISION];
                $columnClass = $this->fieldClasses[self::COLUMN_PRECISION][$fieldType];
                break;
            default:
                throw new InvalidArgumentException("Unknown field type: {$fieldType}");
        }

        $args = [];

        foreach ($defaultFieldParameters as $key => $value) {
            if ($key === self::PROPERTY_OPTIONS
                && isset($fieldData[self::FIELD_PARAMS][self::PROPERTY_OPTIONS])
                && key_exists(self::OPTION_AUTOINCREMENT, $fieldData[self::FIELD_PARAMS][self::PROPERTY_OPTIONS])) {
                trigger_error("Autoincrement field is deprecated", E_USER_DEPRECATED);
            }

            if (isset($fieldData[self::FIELD_PARAMS]) && key_exists($key, $fieldData[self::FIELD_PARAMS])) {
                $args[] = $fieldData[self::FIELD_PARAMS][$key];
            } else {
                $args[] = $value;
            }
        }

        array_unshift($args, $fieldName);

        return new $columnClass(...$args);
    }
498037
public function preSetData(FormEvent $event)
    {
        $entity = $event->getData();
    
        if ($entity instanceof FileInterface && null !== $entity->getId()){
            try {
                $this->fileManager->copyFileToTemporaryDirectory($entity);
            } catch (\Gaufrette\Exception\FileNotFound $e) {
                $event->setData(null);
            }
        }
    }
949901
public function deleteContentTypeGroups(
        ContentTypeGroupsDeleteData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(ContentTypeGroupsDeleteType::class);

        return $this->formFactory->createNamed($name, ContentTypeGroupsDeleteType::class, $data);
    }
1029773
protected function assignField(FieldInterface $field)
    {
        if ($field->mapping() !== null) {
            $this->builder->addSelect(
                sprintf(
                    '%s AS %s',
                    $this->connection->quoteIdentifier($field->mapping()),
                    $this->connection->quoteIdentifier($field->name())
                )
            );
        } else {
            $this->builder->addSelect($this->connection->quoteIdentifier($field->name()));
        }

        $this->casts[$field->name()] = $field->type();
    }
1365898
protected function createCommandFromData(FormInterface $form, Options $options)
    {
        $reflection = new ReflectionClass($this->getCommandClass());
        $data = [];
        /** @var FormInterface $field */
        foreach ($form as $field) {
            $data[$field->getName()] = $field->getData();
        }

        return $reflection->newInstanceArgs($data);
    }
1108597
public function updateUserSetting(
        string $userSettingIdentifier,
        UserSettingUpdateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(UserSettingUpdateType::class);

        return $this->formFactory->createNamed(
            $name,
            UserSettingUpdateType::class,
            $data,
            ['user_setting_identifier' => $userSettingIdentifier]
        );
    }
819138
public function create($formType, InputInterface $input, array $options = [])
    {
        $options = $this->addDefaultOptions($options);

        $formBuilder = $this->formFactory->createBuilder(FormUtil::formTypeToString($formType), null, $options);

        foreach ($formBuilder as $name => $childBuilder) {
            /* @var FormBuilderInterface $childBuilder */
            if (!$input->hasOption($name)) {
                continue;
            }

            $providedValue = $input->getOption($name);
            if ($providedValue === null) {
                continue;
            }

            $childBuilder->setData($providedValue);
        }

        return $formBuilder->getForm();
    }
1229705
protected function setDataType(Field & $field, $type)
    {
        $map = $this->dataTypeMap();

        if (array_key_exists($type, $map)) {
            $field->dataType = $map[$type];
        }

        return $this;
    }
625422
public function setFormFieldTypeRangedTo($formFieldTypeRangedTo)
    {
        if (!is_string($formFieldTypeRangedTo) || empty($formFieldTypeRangedTo)) {
            throw new InvalidArgumentException('"Form field type ranged to" argument must be string and must not be empty.');
        }

        $this->formFieldTypeRangedTo = $formFieldTypeRangedTo;

        return $this;
    }
817267
public function setFormFieldTypeRangedFrom($formFieldTypeRangedFrom)
    {
        if (!is_string($formFieldTypeRangedFrom) || empty($formFieldTypeRangedFrom)) {
            throw new InvalidArgumentException('"Form field type ranged from" argument must be string and must not be empty.');
        }

        $this->formFieldTypeRangedFrom = $formFieldTypeRangedFrom;

        return $this;
    }
353833
public function processFieldsChangeType(ContentTypeInterface $contentType, $fieldTypes)
    {
        foreach ($contentType->getFields() as $field) {
            if (!isset($fieldTypes[$field->getId()])) {
                continue;
            }
            if ($fieldTypes[$field->getId()] == $field->getType()) {
                continue;
            }

            $this->om->remove($field);

            $fieldClass = $this->configurationManager->getEntityClass('field');
            $newField = new $fieldClass;
            $newField->setType($field->getType());
            $newField->setContentType($field->getContentType());
            $newField->setName($field->getName());
            $newField->setSlug($field->getSlug());
            $newField->setRequired($field->isRequired());
            $newField->setSortOrder($field->getSortOrder());
            $newField->setOptions($field->getOptions());
            $newField->setHint($field->getHint());
            $this->om->persist($newField);
        }
    }
344259
private function appendProperForm(FormInterface $form, Definition $definition)
    {
        $identifier = $definition->getIdentifier();
        if ($form->has($identifier)) {
            return;
        }

        $type = sprintf('ekyna_%s_characteristic', $definition->getType());
        $options = array();
        if ($definition->getType() == 'choice') {
            $options['identifier'] = $identifier;
        }

        $parentData = null;
        if (null !== $this->parentDatas && null !== $characteristic = $this->parentDatas->findCharacteristicByIdentifier($identifier)) {
            $parentData = $characteristic->display($definition);
        }

        $form->add($identifier, $type, array_merge(array(
            'property_path' => '[' . $identifier . ']',
            'label' => $definition->getTitle(),
            'parent_data' => $parentData,
        ), $options));
    }
601185
public void setDataType(String type)  {
        addField(ConfigureNodeFields.type, FormField.Type.text_single);
        setAnswer(ConfigureNodeFields.type.getFieldName(), type);
    }
1006891
public function fieldValue(EntityInterface $data, $field)
    {
        if (empty($data)) {
            $data = $this->getContext();
        }

        return $data->get($field);
    }
1368843
protected function _setFieldData($fieldName, $value, $dataType = \OxidEsales\Eshop\Core\Field::T_TEXT)
    {
        //preliminary quick check saves 3% of execution time in category lists by avoiding redundant strtolower() call
        $fieldNameIndex2 = $fieldName[2];
        if ($fieldNameIndex2 === 'l' || $fieldNameIndex2 === 'L' || (isset($fieldName[16]) && ($fieldName[16] == 'l' || $fieldName[16] == 'L'))) {
            $loweredFieldName = strtolower($fieldName);
            if ('oxlongdesc' === $loweredFieldName || 'oxcategories__oxlongdesc' === $loweredFieldName) {
                $dataType = \OxidEsales\Eshop\Core\Field::T_RAW;
            }
        }

        return parent::_setFieldData($fieldName, $value, $dataType);
    }