public function buildSPIContentTypeUpdateStruct(APIContentTypeDraft $contentTypeDraft, APIContentTypeUpdateStruct $contentTypeUpdateStruct, APIUserReference $user)
    {
        $updateStruct = new SPIContentTypeUpdateStruct();

        $updateStruct->identifier = $contentTypeUpdateStruct->identifier !== null ?
            $contentTypeUpdateStruct->identifier :
            $contentTypeDraft->identifier;
        $updateStruct->remoteId = $contentTypeUpdateStruct->remoteId !== null ?
            $contentTypeUpdateStruct->remoteId :
            $contentTypeDraft->remoteId;

        $updateStruct->name = $contentTypeUpdateStruct->names !== null ?
            $contentTypeUpdateStruct->names :
            $contentTypeDraft->names;
        $updateStruct->description = $contentTypeUpdateStruct->descriptions !== null ?
            $contentTypeUpdateStruct->descriptions :
            $contentTypeDraft->descriptions;

        $updateStruct->modified = $contentTypeUpdateStruct->modificationDate !== null ?
            $contentTypeUpdateStruct->modificationDate->getTimestamp() :
            time();
        $updateStruct->modifierId = $contentTypeUpdateStruct->modifierId !== null ?
            $contentTypeUpdateStruct->modifierId :
            $user->getUserId();

        $updateStruct->urlAliasSchema = $contentTypeUpdateStruct->urlAliasSchema !== null ?
            $contentTypeUpdateStruct->urlAliasSchema :
            $contentTypeDraft->urlAliasSchema;
        $updateStruct->nameSchema = $contentTypeUpdateStruct->nameSchema !== null ?
            $contentTypeUpdateStruct->nameSchema :
            $contentTypeDraft->nameSchema;

        $updateStruct->isContainer = $contentTypeUpdateStruct->isContainer !== null ?
            $contentTypeUpdateStruct->isContainer :
            $contentTypeDraft->isContainer;
        $updateStruct->sortField = $contentTypeUpdateStruct->defaultSortField !== null ?
            $contentTypeUpdateStruct->defaultSortField :
            $contentTypeDraft->defaultSortField;
        $updateStruct->sortOrder = $contentTypeUpdateStruct->defaultSortOrder !== null ?
            (int)$contentTypeUpdateStruct->defaultSortOrder :
            $contentTypeDraft->defaultSortOrder;

        $updateStruct->defaultAlwaysAvailable = $contentTypeUpdateStruct->defaultAlwaysAvailable !== null ?
            $contentTypeUpdateStruct->defaultAlwaysAvailable :
            $contentTypeDraft->defaultAlwaysAvailable;
        $updateStruct->initialLanguageId = $this->contentLanguageHandler->loadByLanguageCode(
            $contentTypeUpdateStruct->mainLanguageCode !== null ? $contentTypeUpdateStruct->mainLanguageCode : $contentTypeDraft->mainLanguageCode
        )->id;

        return $updateStruct;
    }
public function buildSPIContentTypeUpdateStruct(APIContentTypeDraft $contentTypeDraft, APIContentTypeUpdateStruct $contentTypeUpdateStruct, APIUserReference $user)
    {
        $updateStruct = new SPIContentTypeUpdateStruct();

        $updateStruct->identifier = $contentTypeUpdateStruct->identifier !== null ?
            $contentTypeUpdateStruct->identifier :
            $contentTypeDraft->identifier;
        $updateStruct->remoteId = $contentTypeUpdateStruct->remoteId !== null ?
            $contentTypeUpdateStruct->remoteId :
            $contentTypeDraft->remoteId;

        $updateStruct->name = $contentTypeUpdateStruct->names !== null ?
            $contentTypeUpdateStruct->names :
            $contentTypeDraft->names;
        $updateStruct->description = $contentTypeUpdateStruct->descriptions !== null ?
            $contentTypeUpdateStruct->descriptions :
            $contentTypeDraft->descriptions;

        $updateStruct->modified = $contentTypeUpdateStruct->modificationDate !== null ?
            $contentTypeUpdateStruct->modificationDate->getTimestamp() :
            time();
        $updateStruct->modifierId = $contentTypeUpdateStruct->modifierId !== null ?
            $contentTypeUpdateStruct->modifierId :
            $user->getUserId();

        $updateStruct->urlAliasSchema = $contentTypeUpdateStruct->urlAliasSchema !== null ?
            $contentTypeUpdateStruct->urlAliasSchema :
            $contentTypeDraft->urlAliasSchema;
        $updateStruct->nameSchema = $contentTypeUpdateStruct->nameSchema !== null ?
            $contentTypeUpdateStruct->nameSchema :
            $contentTypeDraft->nameSchema;

        $updateStruct->isContainer = $contentTypeUpdateStruct->isContainer !== null ?
            $contentTypeUpdateStruct->isContainer :
            $contentTypeDraft->isContainer;
        $updateStruct->sortField = $contentTypeUpdateStruct->defaultSortField !== null ?
            $contentTypeUpdateStruct->defaultSortField :
            $contentTypeDraft->defaultSortField;
        $updateStruct->sortOrder = $contentTypeUpdateStruct->defaultSortOrder !== null ?
            (int)$contentTypeUpdateStruct->defaultSortOrder :
            $contentTypeDraft->defaultSortOrder;

        $updateStruct->defaultAlwaysAvailable = $contentTypeUpdateStruct->defaultAlwaysAvailable !== null ?
            $contentTypeUpdateStruct->defaultAlwaysAvailable :
            $contentTypeDraft->defaultAlwaysAvailable;
        $updateStruct->initialLanguageId = $this->contentLanguageHandler->loadByLanguageCode(
            $contentTypeUpdateStruct->mainLanguageCode !== null ? $contentTypeUpdateStruct->mainLanguageCode : $contentTypeDraft->mainLanguageCode
        )->id;

        return $updateStruct;
    }
public function buildSPIContentTypeUpdateStruct ( APIContentTypeDraft $ contentTypeDraft , APIContentTypeUpdateStruct $ contentTypeUpdateStruct , APIUserReference $ user ) { $ updateStruct = new SPIContentTypeUpdateStruct ( ) ; $ updateStruct -> identifier = $ contentTypeUpdateStruct -> identifier !== null ? $ contentTypeUpdateStruct -> identifier : $ contentTypeDraft -> identifier ; $ updateStruct -> remoteId = $ contentTypeUpdateStruct -> remoteId !== null ? $ contentTypeUpdateStruct -> remoteId : $ contentTypeDraft -> remoteId ; $ updateStruct -> name = $ contentTypeUpdateStruct -> names !== null ? $ contentTypeUpdateStruct -> names : $ contentTypeDraft -> names ; $ updateStruct -> description = $ contentTypeUpdateStruct -> descriptions !== null ? $ contentTypeUpdateStruct -> descriptions : $ contentTypeDraft -> descriptions ; $ updateStruct -> modified = $ contentTypeUpdateStruct -> modificationDate !== null ? $ contentTypeUpdateStruct -> modificationDate -> getTimestamp ( ) : time ( ) ; $ updateStruct -> modifierId = $ contentTypeUpdateStruct -> modifierId !== null ? $ contentTypeUpdateStruct -> modifierId : $ user -> getUserId ( ) ; $ updateStruct -> urlAliasSchema = $ contentTypeUpdateStruct -> urlAliasSchema !== null ? $ contentTypeUpdateStruct -> urlAliasSchema : $ contentTypeDraft -> urlAliasSchema ; $ updateStruct -> nameSchema = $ contentTypeUpdateStruct -> nameSchema !== null ? $ contentTypeUpdateStruct -> nameSchema : $ contentTypeDraft -> nameSchema ; $ updateStruct -> isContainer = $ contentTypeUpdateStruct -> isContainer !== null ? $ contentTypeUpdateStruct -> isContainer : $ contentTypeDraft -> isContainer ; $ updateStruct -> sortField = $ contentTypeUpdateStruct -> defaultSortField !== null ? $ contentTypeUpdateStruct -> defaultSortField : $ contentTypeDraft -> defaultSortField ; $ updateStruct -> sortOrder = $ contentTypeUpdateStruct -> defaultSortOrder !== null ? ( int ) $ contentTypeUpdateStruct -> defaultSortOrder : $ contentTypeDraft -> defaultSortOrder ; $ updateStruct -> defaultAlwaysAvailable = $ contentTypeUpdateStruct -> defaultAlwaysAvailable !== null ? $ contentTypeUpdateStruct -> defaultAlwaysAvailable : $ contentTypeDraft -> defaultAlwaysAvailable ; $ updateStruct -> initialLanguageId = $ this -> contentLanguageHandler -> loadByLanguageCode ( $ contentTypeUpdateStruct -> mainLanguageCode !== null ? $ contentTypeUpdateStruct -> mainLanguageCode : $ contentTypeDraft -> mainLanguageCode ) -> id ; return $ updateStruct ; }
Builds ContentType update struct for storage layer.

@param \eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft $contentTypeDraft
@param \eZ\Publish\API\Repository\Values\ContentType\ContentTypeUpdateStruct $contentTypeUpdateStruct
@param \eZ\Publish\API\Repository\Values\User\UserReference $user

@return \eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct
Builds ContentType update struct for storage layer .