eZ\Publish\Core\Persistence\Legacy\Content\Mapper::createContentInfoFromCreateStruct PHP Method

createContentInfoFromCreateStruct() private method

Creates a Content from the given $struct and $currentVersionNo.
private createContentInfoFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\CreateStruct $struct, mixed $currentVersionNo = 1 ) : eZ\Publish\SPI\Persistence\Content\ContentInfo
$struct eZ\Publish\SPI\Persistence\Content\CreateStruct
$currentVersionNo mixed
return eZ\Publish\SPI\Persistence\Content\ContentInfo
    private function createContentInfoFromCreateStruct(CreateStruct $struct, $currentVersionNo = 1)
    {
        $contentInfo = new ContentInfo();
        $contentInfo->id = null;
        $contentInfo->contentTypeId = $struct->typeId;
        $contentInfo->sectionId = $struct->sectionId;
        $contentInfo->ownerId = $struct->ownerId;
        $contentInfo->alwaysAvailable = $struct->alwaysAvailable;
        $contentInfo->remoteId = $struct->remoteId;
        $contentInfo->mainLanguageCode = $this->languageHandler->load($struct->initialLanguageId)->languageCode;
        $contentInfo->name = isset($struct->name[$contentInfo->mainLanguageCode]) ? $struct->name[$contentInfo->mainLanguageCode] : '';
        // For drafts published and modified timestamps should be 0
        $contentInfo->publicationDate = 0;
        $contentInfo->modificationDate = 0;
        $contentInfo->currentVersionNo = $currentVersionNo;
        $contentInfo->isPublished = false;
        return $contentInfo;
    }