Exemplo n.º 1
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);
 }