summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-09-11 16:42:03 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-09-12 01:00:32 +0200
commit09f60e75c90e5734a3b11a0cca944bd42bc41665 (patch)
tree8ecdc41cd6bb7c2b338e8e82b2b1e090b4d82ce4 /db
parent24cab805e7484a5d206974d05f8de38641435f8c (diff)
#342 implement export
Diffstat (limited to 'db')
-rw-r--r--db/item.php17
-rw-r--r--db/itemmapper.php9
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` = ? ' .