diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/item.php | 17 | ||||
-rw-r--r-- | db/itemmapper.php | 9 |
2 files changed, 26 insertions, 0 deletions
diff --git a/db/item.php b/db/item.php index 1326b65ba..c83da572d 100644 --- a/db/item.php +++ b/db/item.php @@ -109,6 +109,23 @@ class Item extends Entity implements IAPI { } + public function toExport($feeds) { + return array( + 'guid' => $this->getGuid(), + 'url' => $this->getUrl(), + 'title' => $this->getTitle(), + 'author' => $this->getAuthor(), + 'pubDate' => $this->getPubDate(), + 'body' => $this->getBody(), + 'enclosureMime' => $this->getEnclosureMime(), + 'enclosureLink' => $this->getEnclosureLink(), + 'unread' => $this->isUnread(), + 'starred' => $this->isStarred(), + 'feedLink' => $feeds['feed'. $this->getFeedId()]->getLink() + ); + } + + public function setAuthor($name) { parent::setAuthor(strip_tags($name)); } diff --git a/db/itemmapper.php b/db/itemmapper.php index 0a78b02df..8fa40e8eb 100644 --- a/db/itemmapper.php +++ b/db/itemmapper.php @@ -230,6 +230,15 @@ class ItemMapper extends Mapper implements IMapper { } + public function findAllUnreadOrStarred($userId) { + $params = array($userId); + $status = StatusFlag::UNREAD | StatusFlag::STARRED; + $sql = 'AND ((`items`.`status` & ' . $status . ') > 0) '; + $sql = $this->makeSelectQuery($sql); + return $this->findAllRows($sql, $params); + } + + public function findByGuidHash($guidHash, $feedId, $userId){ $sql = $this->makeSelectQuery( 'AND `items`.`guid_hash` = ? ' . |