/** * @brief Retrieve all the item corresponding to a feed from the database * @param feedid The id of the feed in the database table. */ public function findByFeedId($feedid) { $stmt = \OCP\DB::prepare('SELECT * FROM ' . self::tableName . ' WHERE feed_id = ? ORDER BY pub_date DESC'); $result = $stmt->execute(array($feedid)); $feedmapper = new FeedMapper($this->userid); $feed = $feedmapper->findById($feedid); $items = array(); while ($row = $result->fetchRow()) { $item = $this->fromRow($row); $item->setFeedTitle($feed->getTitle()); $items[] = $item; } return $items; }