Will basically return a hash containing all field values from ezcontentobject_version table plus following keys:
- names => Hash of content object names. Key is the language code, value is the name.
- languages => Hash of language ids. Key is the language code (e.g. "eng-GB"), value is the language numeric id without the always available bit.
- initial_language_code => Language code for initial language in this version.
/** * Returns the version object for a content/version identified by $contentId and $versionNo. * * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If version is not found * * @param int|string $contentId * @param int $versionNo Version number to load * * @return \eZ\Publish\SPI\Persistence\Content\VersionInfo */ public function loadVersionInfo($contentId, $versionNo) { $rows = $this->contentGateway->loadVersionInfo($contentId, $versionNo); if (empty($rows)) { throw new NotFound('content', $contentId); } $versionInfo = $this->mapper->extractVersionInfoListFromRows($rows, $this->contentGateway->loadVersionedNameData(array(array('id' => $contentId, 'version' => $versionNo)))); return reset($versionInfo); }
/** * Loads version info for content identified by $contentId and $versionNo. * Will basically return a hash containing all field values from ezcontentobject_version table plus following keys: * - names => Hash of content object names. Key is the language code, value is the name. * - languages => Hash of language ids. Key is the language code (e.g. "eng-GB"), value is the language numeric id without the always available bit. * - initial_language_code => Language code for initial language in this version. * * @param int $contentId * @param int $versionNo * * @return array */ public function loadVersionInfo($contentId, $versionNo) { try { return $this->innerGateway->loadVersionInfo($contentId, $versionNo); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }