public function buildFieldDefinitionDomainObject(SPIFieldDefinition $spiFieldDefinition, $mainLanguageCode, array $prioritizedLanguages = [])
    {
        /** @var $fieldType \eZ\Publish\SPI\FieldType\FieldType */
        $fieldType = $this->fieldTypeRegistry->getFieldType($spiFieldDefinition->fieldType);
        $fieldDefinition = new FieldDefinition(
            array(
                'names' => $spiFieldDefinition->name,
                'descriptions' => $spiFieldDefinition->description,
                'id' => $spiFieldDefinition->id,
                'identifier' => $spiFieldDefinition->identifier,
                'fieldGroup' => $spiFieldDefinition->fieldGroup,
                'position' => $spiFieldDefinition->position,
                'fieldTypeIdentifier' => $spiFieldDefinition->fieldType,
                'isTranslatable' => $spiFieldDefinition->isTranslatable,
                'isRequired' => $spiFieldDefinition->isRequired,
                'isInfoCollector' => $spiFieldDefinition->isInfoCollector,
                'defaultValue' => $fieldType->fromPersistenceValue($spiFieldDefinition->defaultValue),
                'isSearchable' => !$fieldType->isSearchable() ? false : $spiFieldDefinition->isSearchable,
                'fieldSettings' => (array)$spiFieldDefinition->fieldTypeConstraints->fieldSettings,
                'validatorConfiguration' => (array)$spiFieldDefinition->fieldTypeConstraints->validators,
                'prioritizedLanguages' => $prioritizedLanguages,
                'mainLanguageCode' => $mainLanguageCode,
            )
        );

        return $fieldDefinition;
    }
public function buildFieldDefinitionDomainObject(SPIFieldDefinition $spiFieldDefinition, $mainLanguageCode, array $prioritizedLanguages = [])
    {
        /** @var $fieldType \eZ\Publish\SPI\FieldType\FieldType */
        $fieldType = $this->fieldTypeRegistry->getFieldType($spiFieldDefinition->fieldType);
        $fieldDefinition = new FieldDefinition(
            array(
                'names' => $spiFieldDefinition->name,
                'descriptions' => $spiFieldDefinition->description,
                'id' => $spiFieldDefinition->id,
                'identifier' => $spiFieldDefinition->identifier,
                'fieldGroup' => $spiFieldDefinition->fieldGroup,
                'position' => $spiFieldDefinition->position,
                'fieldTypeIdentifier' => $spiFieldDefinition->fieldType,
                'isTranslatable' => $spiFieldDefinition->isTranslatable,
                'isRequired' => $spiFieldDefinition->isRequired,
                'isInfoCollector' => $spiFieldDefinition->isInfoCollector,
                'defaultValue' => $fieldType->fromPersistenceValue($spiFieldDefinition->defaultValue),
                'isSearchable' => !$fieldType->isSearchable() ? false : $spiFieldDefinition->isSearchable,
                'fieldSettings' => (array)$spiFieldDefinition->fieldTypeConstraints->fieldSettings,
                'validatorConfiguration' => (array)$spiFieldDefinition->fieldTypeConstraints->validators,
                'prioritizedLanguages' => $prioritizedLanguages,
                'mainLanguageCode' => $mainLanguageCode,
            )
        );

        return $fieldDefinition;
    }
public function buildFieldDefinitionDomainObject ( SPIFieldDefinition $ spiFieldDefinition , $ mainLanguageCode , array $ prioritizedLanguages = [ ] ) { /** @var $fieldType \eZ\Publish\SPI\FieldType\FieldType */ $ fieldType = $ this -> fieldTypeRegistry -> getFieldType ( $ spiFieldDefinition -> fieldType ) ; $ fieldDefinition = new FieldDefinition ( array ( 'names' => $ spiFieldDefinition -> name , 'descriptions' => $ spiFieldDefinition -> description , 'id' => $ spiFieldDefinition -> id , 'identifier' => $ spiFieldDefinition -> identifier , 'fieldGroup' => $ spiFieldDefinition -> fieldGroup , 'position' => $ spiFieldDefinition -> position , 'fieldTypeIdentifier' => $ spiFieldDefinition -> fieldType , 'isTranslatable' => $ spiFieldDefinition -> isTranslatable , 'isRequired' => $ spiFieldDefinition -> isRequired , 'isInfoCollector' => $ spiFieldDefinition -> isInfoCollector , 'defaultValue' => $ fieldType -> fromPersistenceValue ( $ spiFieldDefinition -> defaultValue ) , 'isSearchable' => ! $ fieldType -> isSearchable ( ) ? false : $ spiFieldDefinition -> isSearchable , 'fieldSettings' => ( array ) $ spiFieldDefinition -> fieldTypeConstraints -> fieldSettings , 'validatorConfiguration' => ( array ) $ spiFieldDefinition -> fieldTypeConstraints -> validators , 'prioritizedLanguages' => $ prioritizedLanguages , 'mainLanguageCode' => $ mainLanguageCode , ) ) ; return $ fieldDefinition ; }
Builds a FieldDefinition domain object from value object returned by persistence.

@param \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $spiFieldDefinition
@param string $mainLanguageCode
@param string[] $prioritizedLanguages

@return \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition
Builds a FieldDefinition domain object from value object returned by persistence .