Converts field definition data in $storageDef into $fieldDef.

@param \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition $storageDef
@param \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDef
762098
public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)
    {
        $fieldDef->defaultValue->data = !empty($storageDef->dataInt3) ? (bool)$storageDef->dataInt3 : false;
    }
876880
protected function generateAddFieldSql( $tableName, $fieldName, ezcDbSchemaField $fieldDefinition )
    {
        $this->queries[] = "ALTER TABLE \"$tableName\" ADD " . $this->generateFieldSql( $fieldName, $fieldDefinition );
    }
290110
public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageFieldDefinition $storageDef)
    {
        $storageDef->dataText1 = $fieldDef->defaultValue->data;
    }
1368315
private function updateFieldDefinition(FieldDefinitionObject $field)
    {
        $definition = $this->contentTypeService->newFieldDefinitionUpdateStruct();
        $field->getMapper()->mapObjectToUpdateStruct($definition);

        return $definition;
    }
87948
public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageFieldDefinition $storageDef)
    {
        parent::toStorageFieldDefinition($fieldDef, $storageDef);

        $storageDef->dataText1 = (isset($fieldDef->fieldTypeConstraints->fieldSettings['mediaType'])
            ? $fieldDef->fieldTypeConstraints->fieldSettings['mediaType']
            : MediaType::TYPE_HTML5_VIDEO);
    }
709115
private function handleCustomFileTree(&$fieldDefinition)
    {
        if ($this->get('file_uploadFolder')) {
            // Set root path of file chooser depending on contao version.
            $file = null;

            if ($this->validator->isStringUuid($this->get('file_uploadFolder'))
                || $this->validator->isBinaryUuid($this->get('file_uploadFolder'))
            ) {
                $file = $this->fileRepository->findByUuid($this->get('file_uploadFolder'));
            }

            // Check if we have a file.
            if (null !== $file) {
                $fieldDefinition['eval']['path'] = $file->path;
            } else {
                // Fallback.
                $fieldDefinition['eval']['path'] = $this->get('file_uploadFolder');
            }
        }

        if ($this->get('file_validFileTypes')) {
            $fieldDefinition['eval']['extensions'] = $this->get('file_validFileTypes');
        }

        if ($this->get('file_filesOnly')) {
            $fieldDefinition['eval']['filesOnly'] = true;
        }
    }
814187
public function toStorageFieldDefinition( FieldDefinition $fieldDef, StorageFieldDefinition $storageDef )
    {
        $fieldSettings = $fieldDef->fieldTypeConstraints->fieldSettings;

        if (isset($fieldSettings['configuration'])) {
            $storageDef->dataText5 = json_encode($fieldSettings['configuration']);
        }
    }
36844
public void addStoreDefinition(StoreDefinition storeDef) {
        // acquire write lock
        writeLock.lock();

        try {
            // Check if store already exists
            if(this.storeNames.contains(storeDef.getName())) {
                throw new VoldemortException("Store already exists !");
            }

            // Check for backwards compatibility
            StoreDefinitionUtils.validateSchemaAsNeeded(storeDef);

            // Otherwise add to the STORES directory
            StoreDefinitionsMapper mapper = new StoreDefinitionsMapper();
            String storeDefStr = mapper.writeStore(storeDef);
            Versioned<String> versionedValueStr = new Versioned<String>(storeDefStr);
            this.storeDefinitionsStorageEngine.put(storeDef.getName(), versionedValueStr, null);

            // Update the metadata cache
            this.metadataCache.put(storeDef.getName(), new Versioned<Object>(storeDefStr));

            // Re-initialize the store definitions. This is primarily required
            // to re-create the value for key: 'stores.xml'. This is necessary
            // for backwards compatibility.
            initStoreDefinitions(null);

            updateRoutingStrategies(getCluster(), getStoreDefList());
        } finally {
            writeLock.unlock();
        }
    }
1054105
public function getIndexData(Field $field, FieldDefinition $fieldDefinition)
    {
        return array(
            new Search\Field(
                'filename',
                $field->value->data['fileName'],
                new Search\FieldType\StringField()
            ),
            new Search\Field(
                'alternative_text',
                $field->value->data['alternativeText'],
                new Search\FieldType\StringField()
            ),
            new Search\Field(
                'file_size',
                $field->value->data['fileSize'],
                new Search\FieldType\IntegerField()
            ),
            new Search\Field(
                'mime_type',
                $field->value->data['mime'],
                new Search\FieldType\StringField()
            ),
        );
    }
736929
public function getIndexData(Field $field, FieldDefinition $fieldDefinition)
    {
        $indexes = array();
        $values = array();
        $fieldSettings = $fieldDefinition->fieldTypeConstraints->fieldSettings;
        $positionSet = array_flip($field->value->data);

        $options = $fieldSettings['multilingualOptions'][$field->languageCode] ?? $fieldSettings['options'];

        foreach ($options as $index => $value) {
            if (isset($positionSet[$index])) {
                $values[] = $value;
                $indexes[] = $index;
            }
        }

        return array(
            new Search\Field(
                'selected_option_value',
                $values,
                new Search\FieldType\MultipleStringField()
            ),
            new Search\Field(
                'selected_option_index',
                $indexes,
                new Search\FieldType\MultipleIntegerField()
            ),
            new Search\Field(
                'selected_option_count',
                count($indexes),
                new Search\FieldType\IntegerField()
            ),
            new Search\Field(
                'sort_value',
                implode('-', $indexes),
                new Search\FieldType\StringField()
            ),
            new Search\Field(
                'fulltext',
                $values,
                new Search\FieldType\FullTextField()
            ),
        );
    }
422507
public function getIndexData(Field $field, FieldDefinition $fieldDefinition)
    {
        return array(
            new Search\Field(
                'value',
                reset($field->value->data),
                new Search\FieldType\StringField()
            ),
        );
    }
700268
public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)
    {
        $fieldDef->fieldTypeConstraints->fieldSettings = new FieldSettings(
            array(
                'defaultType' => $storageDef->dataInt1,
                'useSeconds' => (bool)$storageDef->dataInt2,
            )
        );

        // Building default value
        switch ($fieldDef->fieldTypeConstraints->fieldSettings['defaultType']) {
            case TimeType::DEFAULT_CURRENT_TIME:
                $dateTime = new DateTime();
                $data = $dateTime->getTimestamp() - $dateTime->setTime(0, 0, 0)->getTimestamp();
                break;
            default:
                $data = null;
        }

        $fieldDef->defaultValue->data = $data;
    }
917373
public function setFieldDec($fieldName, float $decValue = 1)
    {
        $this->option->saveData[$fieldName] = new Raw(new Field($fieldName) . ' - ' . $decValue);
        return $this;
    }
697064
public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)
    {
        $fieldDef->fieldTypeConstraints->fieldSettings = new FieldSettings(
            [
                'hideRootTag' => (bool) $storageDef->dataInt3,
                'editView' => $storageDef->dataText1,
            ],
            FieldSettings::ARRAY_AS_PROPS
        );

        $fieldDef->fieldTypeConstraints->validators = [
            static::TAGS_VALIDATOR_IDENTIFIER => [
                'subTreeLimit' => (int) $storageDef->dataInt1,
                'maxTags' => (int) $storageDef->dataInt4,
            ],
        ];
    }
48611
public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)
    {
        // @todo: Is it possible to store a default value in the DB?
        $fieldDef->defaultValue = new FieldValue();
        $fieldDef->defaultValue->data = array('text' => null);
    }
399187
public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue)
    {
        $data = trim($value->dataText);
        $fieldValue->data = empty($data) ? array() : explode(',', $data);
    }
184080
public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageFieldDefinition $storageDef)
    {
        $storageDef->dataInt3 = (int)$fieldDef->defaultValue->data;
    }