diff options
Diffstat (limited to 'db/item.php')
-rw-r--r-- | db/item.php | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/db/item.php b/db/item.php index ad245d486..66ee0ef7e 100644 --- a/db/item.php +++ b/db/item.php @@ -1,12 +1,25 @@ <?php + /** -* ownCloud - News app +* ownCloud - News * * @author Alessandro Cosentino -* Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com> +* @author Bernhard Posselt +* @copyright 2012 Alessandro Cosentino cosenal@gmail.com +* @copyright 2012 Bernhard Posselt nukeawhale@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. * -* This file is licensed under the Affero General Public License version 3 or later. -* See the COPYING-README file +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ @@ -25,6 +38,15 @@ class Item extends Entity { public $feedTitle; public $enclosure; + public function setRead() { + $this->markFieldUpdated('status'); + $this->status &= ~StatusFlag::UNREAD; + } + + public function isRead() { + return !($this->status & StatusFlag::UNREAD); + } + } @@ -60,17 +82,13 @@ class Item extends Entity { - public function setRead() { - $this->status &= ~StatusFlag::UNREAD; - } + public function setUnread() { $this->status |= StatusFlag::UNREAD; } - public function isRead() { - return !($this->status & StatusFlag::UNREAD); - } + public function setImportant() { $this->status |= StatusFlag::IMPORTANT; |