Result is returned with oldest version first (using version id as it has index and is auto increment).
abstract public listVersions ( mixed $contentId ) : string[][] | ||
$contentId | mixed | |
리턴 | string[][] |
/** * Returns all version data for the given $contentId * * @param mixed $contentId * * @return string[][] */ public function listVersions($contentId) { try { return $this->innerGateway->listVersions($contentId); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }
/** * Returns the versions for $contentId. * * @param int $contentId * * @return \eZ\Publish\SPI\Persistence\Content\VersionInfo[] */ public function listVersions($contentId) { $rows = $this->contentGateway->listVersions($contentId); if (empty($rows)) { return array(); } $idVersionPairs = array_map(function ($row) use($contentId) { return array('id' => $contentId, 'version' => $row['ezcontentobject_version_version']); }, $rows); $nameRows = $this->contentGateway->loadVersionedNameData($idVersionPairs); return $this->contentMapper->extractVersionInfoListFromRows($rows, $nameRows); }
/** * Returns the versions for $contentId * * @param int $contentId * * @return \eZ\Publish\SPI\Persistence\Content\VersionInfo[] */ public function listVersions($contentId) { return $this->contentMapper->extractVersionInfoListFromRows($this->contentGateway->listVersions($contentId)); }