listVersions() abstract public method

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
return 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);
     }
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * 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));
 }