public function buildLocationDomainObject(SPILocation $spiLocation)
{
// TODO: this is hardcoded workaround for missing ContentInfo on root location
if ($spiLocation->id == 1) {
$legacyDateTime = $this->getDateTime(1030968000);
// first known commit of eZ Publish 3.x
$contentInfo = new ContentInfo(array('id' => 0, 'name' => 'Top Level Nodes', 'sectionId' => 1, 'mainLocationId' => 1, 'contentTypeId' => 1, 'currentVersionNo' => 1, 'published' => 1, 'ownerId' => 14, 'modificationDate' => $legacyDateTime, 'publishedDate' => $legacyDateTime, 'alwaysAvailable' => 1, 'remoteId' => null, 'mainLanguageCode' => 'eng-GB'));
} else {
$contentInfo = $this->buildContentInfoDomainObject($this->contentHandler->loadContentInfo($spiLocation->contentId));
}
return new Location(array('contentInfo' => $contentInfo, 'id' => $spiLocation->id, 'priority' => $spiLocation->priority, 'hidden' => $spiLocation->hidden, 'invisible' => $spiLocation->invisible, 'remoteId' => $spiLocation->remoteId, 'parentLocationId' => $spiLocation->parentId, 'pathString' => $spiLocation->pathString, 'depth' => $spiLocation->depth, 'sortField' => $spiLocation->sortField, 'sortOrder' => $spiLocation->sortOrder));
}