function getContent() { if ($items = FeedItem::get()) { $t = \Idno\Core\Idno::site()->template(); $t->__(array('title' => 'Stream', 'body' => $t->__(array('items' => $items))->draw('stream/home')))->drawPage(); } }
/** * Saves this item if it hasn't been saved yet * @return $this|bool|false|Entity */ function saveIfNotSaved() { if ($object = FeedItem::getOne(array('url' => $this->url))) { return $object; } if ($this->save()) { return $this; } return false; }
/** * Given a parsed RSS or Atom feed, returns an array of FeedItem objects * @param $rss_content * @param $url * @return array */ function xmlFeedToFeedItems($xml_items, $url) { $items = array(); if (!empty($xml_items)) { foreach ($xml_items as $item) { $entry = new FeedItem(); $entry->loadFromXMLItem($item); $entry->setFeedURL($url); $items[] = $entry; } } return $items; }