Extracts a VersionInfo object from $row.
public extractVersionInfoListFromRows ( array $rows, array $nameRows ) : eZ\Publish\SPI\Persistence\Content\VersionInfo[] | ||
$rows | array | |
$nameRows | array | |
리턴 | eZ\Publish\SPI\Persistence\Content\VersionInfo[] |
/** * 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 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); }
/** * 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)); }
/** * 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)); }