public function mapField(APIField $apiField, SiteContent $content)
    {
        $fieldDefinition = $content->contentInfo->innerContentType->getFieldDefinition($apiField->fieldDefIdentifier);
        $fieldTypeIdentifier = $fieldDefinition->fieldTypeIdentifier;
        $isEmpty = $this->fieldTypeService->getFieldType($fieldTypeIdentifier)->isEmptyValue(
            $apiField->value
        );

        return new Field([
            'id' => $apiField->id,
            'fieldDefIdentifier' => $fieldDefinition->identifier,
            'value' => $apiField->value,
            'languageCode' => $apiField->languageCode,
            'fieldTypeIdentifier' => $fieldTypeIdentifier,
            'name' => $this->getTranslatedString(
                $content->languageCode,
                (array)$fieldDefinition->getNames()
            ),
            'description' => $this->getTranslatedString(
                $content->languageCode,
                (array)$fieldDefinition->getDescriptions()
            ),
            'content' => $content,
            'innerField' => $apiField,
            'innerFieldDefinition' => $fieldDefinition,
            'isEmpty' => $isEmpty,
        ]);
    }
public function mapField(APIField $apiField, SiteContent $content)
    {
        $fieldDefinition = $content->contentInfo->innerContentType->getFieldDefinition($apiField->fieldDefIdentifier);
        $fieldTypeIdentifier = $fieldDefinition->fieldTypeIdentifier;
        $isEmpty = $this->fieldTypeService->getFieldType($fieldTypeIdentifier)->isEmptyValue(
            $apiField->value
        );

        return new Field([
            'id' => $apiField->id,
            'fieldDefIdentifier' => $fieldDefinition->identifier,
            'value' => $apiField->value,
            'languageCode' => $apiField->languageCode,
            'fieldTypeIdentifier' => $fieldTypeIdentifier,
            'name' => $this->getTranslatedString(
                $content->languageCode,
                (array)$fieldDefinition->getNames()
            ),
            'description' => $this->getTranslatedString(
                $content->languageCode,
                (array)$fieldDefinition->getDescriptions()
            ),
            'content' => $content,
            'innerField' => $apiField,
            'innerFieldDefinition' => $fieldDefinition,
            'isEmpty' => $isEmpty,
        ]);
    }
public function mapField ( APIField $ apiField , SiteContent $ content ) { $ fieldDefinition = $ content -> contentInfo -> innerContentType -> getFieldDefinition ( $ apiField -> fieldDefIdentifier ) ; $ fieldTypeIdentifier = $ fieldDefinition -> fieldTypeIdentifier ; $ isEmpty = $ this -> fieldTypeService -> getFieldType ( $ fieldTypeIdentifier ) -> isEmptyValue ( $ apiField -> value ) ; return new Field ( [ 'id' => $ apiField -> id , 'fieldDefIdentifier' => $ fieldDefinition -> identifier , 'value' => $ apiField -> value , 'languageCode' => $ apiField -> languageCode , 'fieldTypeIdentifier' => $ fieldTypeIdentifier , 'name' => $ this -> getTranslatedString ( $ content -> languageCode , ( array ) $ fieldDefinition -> getNames ( ) ) , 'description' => $ this -> getTranslatedString ( $ content -> languageCode , ( array ) $ fieldDefinition -> getDescriptions ( ) ) , 'content' => $ content , 'innerField' => $ apiField , 'innerFieldDefinition' => $ fieldDefinition , 'isEmpty' => $ isEmpty , ] ) ; }
Maps Repository Field to the Site Field.

@param \eZ\Publish\API\Repository\Values\Content\Field $apiField
@param \Netgen\EzPlatformSiteApi\API\Values\Content $content

@return \Netgen\EzPlatformSiteApi\API\Values\Field
Maps Repository Field to the Site Field .