extractVersionInfoListFromRows() public method

Extracts a VersionInfo object from $row.
public extractVersionInfoListFromRows ( array $rows, array $nameRows ) : eZ\Publish\SPI\Persistence\Content\VersionInfo[]
$rows array
$nameRows array
return eZ\Publish\SPI\Persistence\Content\VersionInfo[]
コード例 #1
0
ファイル: TreeHandler.php プロジェクト: Pixy/ezpublish-kernel
 /**
  * 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);
 }
コード例 #2
0
ファイル: Handler.php プロジェクト: Pixy/ezpublish-kernel
 /**
  * Returns all versions with draft status created by the given $userId.
  *
  * @param int $userId
  *
  * @return \eZ\Publish\SPI\Persistence\Content\VersionInfo[]
  */
 public function loadDraftsForUser($userId)
 {
     $rows = $this->contentGateway->listVersionsForUser($userId, VersionInfo::STATUS_DRAFT);
     if (empty($rows)) {
         return array();
     }
     $idVersionPairs = array_map(function ($row) {
         return array('id' => $row['ezcontentobject_version_contentobject_id'], 'version' => $row['ezcontentobject_version_version']);
     }, $rows);
     $nameRows = $this->contentGateway->loadVersionedNameData($idVersionPairs);
     return $this->mapper->extractVersionInfoListFromRows($rows, $nameRows);
 }
コード例 #3
0
ファイル: Handler.php プロジェクト: Heyfara/ezpublish-kernel
 /**
  * Returns all versions with draft status created by the given $userId.
  *
  * @param int $userId
  *
  * @return \eZ\Publish\SPI\Persistence\Content\VersionInfo[]
  */
 public function loadDraftsForUser($userId)
 {
     return $this->mapper->extractVersionInfoListFromRows($this->contentGateway->listVersionsForUser($userId, VersionInfo::STATUS_DRAFT));
 }
コード例 #4
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));
 }