listVersionsForUser() abstract public method

Returns data for all versions with given status created by the given $userId.
abstract public listVersionsForUser ( integer $userId, integer $status = VersionInfo::STATUS_DRAFT ) : string[][]
$userId integer
$status integer
return string[][]
 /**
  * Returns data for all versions with given status created by the given $userId
  *
  * @param int $userId
  * @param int $status
  *
  * @return string[][]
  */
 public function listVersionsForUser($userId, $status = VersionInfo::STATUS_DRAFT)
 {
     try {
         return $this->innerGateway->listVersionsForUser($userId, $status);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }
Example #2
0
 /**
  * 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);
 }
Example #3
0
 /**
  * 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));
 }