diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-10-15 00:36:44 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-10-15 00:37:11 -0400 |
commit | 17814509754fa405d1f7be716cbeca1cd08deda8 (patch) | |
tree | f395c8dcce813ce9f2cbadfa752b5b66bf2b6e1d /lib | |
parent | 1e37bc139bb28e6fe9b0dd0d477e2dbef5a2cab9 (diff) |
specifies name of the blog when showing items
Diffstat (limited to 'lib')
-rw-r--r-- | lib/item.php | 9 | ||||
-rw-r--r-- | lib/itemmapper.php | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/item.php b/lib/item.php index f2d4fbd63..95a64859c 100644 --- a/lib/item.php +++ b/lib/item.php @@ -34,6 +34,7 @@ class Item { private $id; //id of the item in the database table private $author; private $date; //date is stored in the Unix format + private $feedTitle; public function __construct($url, $title, $guid, $body, $id = null) { $this->title = $title; @@ -119,6 +120,14 @@ class Item { public function setTitle($title) { $this->title = $title; } + + public function getFeedTitle() { + return $this->feedTitle; + } + + public function setFeedTitle($feedtitle) { + $this->feedTitle = $feedtitle; + } public function getUrl() { return $this->url; diff --git a/lib/itemmapper.php b/lib/itemmapper.php index 58894cce8..92a3928d7 100644 --- a/lib/itemmapper.php +++ b/lib/itemmapper.php @@ -57,10 +57,12 @@ class ItemMapper { 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; } |