Ejemplo n.º 1
0
 public static function getByFeed($feed)
 {
     $db = Registry::getDatabase();
     $feedSeries = $db->builder()->select()->from('feedSeries')->where('feed = :feed', [':feed' => $feed])->queryAll();
     return array_map(function ($item) {
         return FeedSeries::createFromArray($item);
     }, $feedSeries);
 }
Ejemplo n.º 2
0
 public function collectFeed()
 {
     $feedSeries = FeedSeries::getByFeed($this->id);
     $items = [];
     foreach ($feedSeries as $feedSerie) {
         $feedItems = $feedSerie->getItems();
         foreach ($feedItems as $feedItem) {
             $items[] = ['date' => max($feedSerie->added, $feedItem->recordUpdated), 'item' => $feedItem];
         }
     }
     usort($items, function ($a, $b) {
         return $a['date'] - $b['date'];
     });
     return $items;
 }