public function buildSPIFieldDefinitionCreate(APIFieldDefinitionCreateStruct $fieldDefinitionCreateStruct, SPIFieldType $fieldType)
    {
        $spiFieldDefinition = new SPIFieldDefinition(
            array(
                'id' => null,
                'identifier' => $fieldDefinitionCreateStruct->identifier,
                'fieldType' => $fieldDefinitionCreateStruct->fieldTypeIdentifier,
                'name' => $fieldDefinitionCreateStruct->names === null ?
                    array() :
                    $fieldDefinitionCreateStruct->names,
                'description' => $fieldDefinitionCreateStruct->descriptions === null ?
                    array() :
                    $fieldDefinitionCreateStruct->descriptions,
                'fieldGroup' => $fieldDefinitionCreateStruct->fieldGroup === null ?
                    '' :
                    $fieldDefinitionCreateStruct->fieldGroup,
                'position' => (int)$fieldDefinitionCreateStruct->position,
                'isTranslatable' => $fieldDefinitionCreateStruct->isTranslatable === null ?
                    true :
                    $fieldDefinitionCreateStruct->isTranslatable,
                'isRequired' => $fieldDefinitionCreateStruct->isRequired === null ?
                    false :
                    $fieldDefinitionCreateStruct->isRequired,
                'isInfoCollector' => $fieldDefinitionCreateStruct->isInfoCollector === null ?
                    false :
                    $fieldDefinitionCreateStruct->isInfoCollector,
                'isSearchable' => $fieldDefinitionCreateStruct->isSearchable === null ?
                    $fieldType->isSearchable() :
                    $fieldDefinitionCreateStruct->isSearchable,
                // These properties are precreated in constructor
                //"fieldTypeConstraints"
                //"defaultValue"
            )
        );

        $spiFieldDefinition->fieldTypeConstraints->validators = $fieldDefinitionCreateStruct->validatorConfiguration;
        $spiFieldDefinition->fieldTypeConstraints->fieldSettings = $fieldDefinitionCreateStruct->fieldSettings;
        $spiFieldDefinition->defaultValue = $fieldType->toPersistenceValue(
            $fieldType->acceptValue($fieldDefinitionCreateStruct->defaultValue)
        );

        return $spiFieldDefinition;
    }
public function buildSPIFieldDefinitionCreate(APIFieldDefinitionCreateStruct $fieldDefinitionCreateStruct, SPIFieldType $fieldType)
    {
        $spiFieldDefinition = new SPIFieldDefinition(
            array(
                'id' => null,
                'identifier' => $fieldDefinitionCreateStruct->identifier,
                'fieldType' => $fieldDefinitionCreateStruct->fieldTypeIdentifier,
                'name' => $fieldDefinitionCreateStruct->names === null ?
                    array() :
                    $fieldDefinitionCreateStruct->names,
                'description' => $fieldDefinitionCreateStruct->descriptions === null ?
                    array() :
                    $fieldDefinitionCreateStruct->descriptions,
                'fieldGroup' => $fieldDefinitionCreateStruct->fieldGroup === null ?
                    '' :
                    $fieldDefinitionCreateStruct->fieldGroup,
                'position' => (int)$fieldDefinitionCreateStruct->position,
                'isTranslatable' => $fieldDefinitionCreateStruct->isTranslatable === null ?
                    true :
                    $fieldDefinitionCreateStruct->isTranslatable,
                'isRequired' => $fieldDefinitionCreateStruct->isRequired === null ?
                    false :
                    $fieldDefinitionCreateStruct->isRequired,
                'isInfoCollector' => $fieldDefinitionCreateStruct->isInfoCollector === null ?
                    false :
                    $fieldDefinitionCreateStruct->isInfoCollector,
                'isSearchable' => $fieldDefinitionCreateStruct->isSearchable === null ?
                    $fieldType->isSearchable() :
                    $fieldDefinitionCreateStruct->isSearchable,
                // These properties are precreated in constructor
                //"fieldTypeConstraints"
                //"defaultValue"
            )
        );

        $spiFieldDefinition->fieldTypeConstraints->validators = $fieldDefinitionCreateStruct->validatorConfiguration;
        $spiFieldDefinition->fieldTypeConstraints->fieldSettings = $fieldDefinitionCreateStruct->fieldSettings;
        $spiFieldDefinition->defaultValue = $fieldType->toPersistenceValue(
            $fieldType->acceptValue($fieldDefinitionCreateStruct->defaultValue)
        );

        return $spiFieldDefinition;
    }
public function buildSPIFieldDefinitionCreate ( APIFieldDefinitionCreateStruct $ fieldDefinitionCreateStruct , SPIFieldType $ fieldType ) { $ spiFieldDefinition = new SPIFieldDefinition ( array ( 'id' => null , 'identifier' => $ fieldDefinitionCreateStruct -> identifier , 'fieldType' => $ fieldDefinitionCreateStruct -> fieldTypeIdentifier , 'name' => $ fieldDefinitionCreateStruct -> names === null ? array ( ) : $ fieldDefinitionCreateStruct -> names , 'description' => $ fieldDefinitionCreateStruct -> descriptions === null ? array ( ) : $ fieldDefinitionCreateStruct -> descriptions , 'fieldGroup' => $ fieldDefinitionCreateStruct -> fieldGroup === null ? '' : $ fieldDefinitionCreateStruct -> fieldGroup , 'position' => ( int ) $ fieldDefinitionCreateStruct -> position , 'isTranslatable' => $ fieldDefinitionCreateStruct -> isTranslatable === null ? true : $ fieldDefinitionCreateStruct -> isTranslatable , 'isRequired' => $ fieldDefinitionCreateStruct -> isRequired === null ? false : $ fieldDefinitionCreateStruct -> isRequired , 'isInfoCollector' => $ fieldDefinitionCreateStruct -> isInfoCollector === null ? false : $ fieldDefinitionCreateStruct -> isInfoCollector , 'isSearchable' => $ fieldDefinitionCreateStruct -> isSearchable === null ? $ fieldType -> isSearchable ( ) : $ fieldDefinitionCreateStruct -> isSearchable , // These properties are precreated in constructor //"fieldTypeConstraints" //"defaultValue" ) ) ; $ spiFieldDefinition -> fieldTypeConstraints -> validators = $ fieldDefinitionCreateStruct -> validatorConfiguration ; $ spiFieldDefinition -> fieldTypeConstraints -> fieldSettings = $ fieldDefinitionCreateStruct -> fieldSettings ; $ spiFieldDefinition -> defaultValue = $ fieldType -> toPersistenceValue ( $ fieldType -> acceptValue ( $ fieldDefinitionCreateStruct -> defaultValue ) ) ; return $ spiFieldDefinition ; }
Builds SPIFieldDefinition object using API FieldDefinitionCreateStruct.

@deprecated use \eZ\Publish\Core\Repository\Helper\ContentTypeDomainMapper::buildSPIFieldDefinitionFromCreateStruct()

@throws \eZ\Publish\API\Repository\Exceptions\ContentTypeFieldDefinitionValidationException if validator configuration or
field setting do not validate

@param \eZ\Publish\API\Repository\Values\ContentType\FieldDefinitionCreateStruct $fieldDefinitionCreateStruct
@param \eZ\Publish\SPI\FieldType\FieldType $fieldType

@return \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
Builds SPIFieldDefinition object using API FieldDefinitionCreateStruct .