Пример #1
0
 /**
  * Returns the User which "opened" the channel.
  *
  * @return GenericORMapperDataObject The User which opened the channel.
  */
 public function getAuthor()
 {
     $crit = new GenericCriterionObject();
     $crit->addCountIndicator(1);
     $crit->addOrderIndicator('MessageID', 'ASC');
     /* @var $FirstMessage Message */
     $FirstMessage = $this->loadRelatedObject('MessageChannel2Message', $crit);
     return $FirstMessage->getAuthor();
 }
Пример #2
0
 /**
  * Loads a list of MessageChannels
  *
  * @param int $start The number of the first channel which should be returned (SQL LIMIT)
  * @param int $count The number of channels which should be returned (SQL LIMIT)
  *
  * @return MessageChannel[] A list of MessageChannels.
  */
 public function getChannels($start = 0, $count = 15)
 {
     $crit = new GenericCriterionObject();
     $crit->addCountIndicator((int) $start, (int) $count);
     return $this->loadRelatedObjects('PostboxFolder2MessageChannel', $crit);
 }
Пример #3
0
 /**
  * Loads a list of News.
  *
  * @param int $start The number of the first element which should be loaded.
  * @param int $count The number of how many news could be loaded.
  * @param string $order The Order of how the news should be sorted by creation ('ASC' Or 'DESC')
  * @param string $appKey Optional. Default: Current context. The application identifier, which is used to differentiate different news instances.
  *
  * @return News[] A List of news.
  */
 public function getNews($start = 0, $count = 10, $order = 'DESC', $appKey = null)
 {
     if ($appKey === null) {
         $appKey = $this->getContext();
     }
     $crit = new GenericCriterionObject();
     $crit->addCountIndicator($start, $count)->addOrderIndicator('CreationTimestamp', $order)->addPropertyIndicator('AppKey', $appKey);
     return $this->ORM->loadObjectListByCriterion('News', $crit);
 }