diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-20 11:05:15 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-20 11:05:15 +0100 |
commit | 070abc32e5dd5f64db655330e210178d15a97c72 (patch) | |
tree | 0ad613e2dbc0c9029bda6d019fccebb0ac659d1d /db | |
parent | fa3a2e469db519571fa7dc13bc832e7de1f8057f (diff) |
finished item
Diffstat (limited to 'db')
-rw-r--r-- | db/enclosure.php | 35 | ||||
-rw-r--r-- | db/item.php | 55 | ||||
-rw-r--r-- | db/statusflag.php | 2 |
3 files changed, 28 insertions, 64 deletions
diff --git a/db/enclosure.php b/db/enclosure.php deleted file mode 100644 index 7eaddf158..000000000 --- a/db/enclosure.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** -* ownCloud - News app -* -* @author Alessandro Cosentino -* Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com> -* -* This file is licensed under the Affero General Public License version 3 or later. -* See the COPYING-README file -* -*/ - -namespace OCA\News; - - -class Enclosure { - private $mimetype; - private $link; - - public function getMimeType() { - return $this->mimetype; - } - - public function setMimeType($mimetype) { - $this->mimetype = $mimetype; - } - - public function getLink() { - return $this->link; - } - - public function setLink($link) { - $this->link = $link; - } -} diff --git a/db/item.php b/db/item.php index 66ee0ef7e..4eaa294d3 100644 --- a/db/item.php +++ b/db/item.php @@ -36,7 +36,8 @@ class Item extends Entity { public $author; public $date; public $feedTitle; - public $enclosure; + public $enclosureMime; + public $enclosureLink; public function setRead() { $this->markFieldUpdated('status'); @@ -44,7 +45,31 @@ class Item extends Entity { } public function isRead() { - return !($this->status & StatusFlag::UNREAD); + return !(($this->status & StatusFlag::UNREAD) === StatusFlag::UNREAD); + } + + public function setUnread() { + $this->status |= StatusFlag::UNREAD; + } + + public function isUnread() { + return !$this->isRead(); + } + + public function setStarred() { + $this->status |= StatusFlag::STARRED; + } + + public function isStarred() { + return ($this->status & StatusFlag::STARRED) === StatusFlag::STARRED; + } + + public function setUnstarred() { + $this->status &= ~StatusFlag::STARRED; + } + + public function isUnstarred() { + return !$this->isStarred(); } } @@ -77,32 +102,6 @@ class Item extends Entity { $this->id = $id; } } - - - - - - - - public function setUnread() { - $this->status |= StatusFlag::UNREAD; - } - - - - public function setImportant() { - $this->status |= StatusFlag::IMPORTANT; - } - - public function setUnimportant() { - $this->status &= ~StatusFlag::IMPORTANT; - } - - public function isImportant() { - return ($this->status & StatusFlag::IMPORTANT); - } - - public function getBody() { diff --git a/db/statusflag.php b/db/statusflag.php index 1b01ab42b..351d5d40a 100644 --- a/db/statusflag.php +++ b/db/statusflag.php @@ -27,7 +27,7 @@ namespace OCA\News\Db; class StatusFlag { const UNREAD = 0x02; - const IMPORTANT = 0x04; + const STARRED = 0x04; const DELETED = 0x08; const UPDATED = 0x16; }
\ No newline at end of file |