news/db/statusflag.php

55 строки
1.3 KiB
PHP
Исходник Обычный вид История

2013-01-27 07:15:53 +04:00
<?php
2013-01-27 07:15:53 +04:00
/**
* ownCloud - News
2013-01-27 07:15:53 +04:00
*
* @author Alessandro Cosentino
* @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.
2013-01-27 07:15:53 +04:00
*
* 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/>.
2013-01-27 07:15:53 +04:00
*
*/
namespace OCA\News\Db;
2013-01-27 07:15:53 +04:00
class StatusFlag {
2013-01-27 07:15:53 +04:00
const UNREAD = 0x02;
2013-03-20 19:32:07 +04:00
const STARRED = 0x04;
2013-01-27 07:15:53 +04:00
const DELETED = 0x08;
const UPDATED = 0x16;
2013-03-23 16:24:35 +04:00
/**
* Get status for query
*/
public function typeToStatus($type, $showAll){
if($type === FeedType::STARRED){
return self::STARRED;
2013-03-23 16:24:35 +04:00
} else {
$status = 0;
}
if($showAll){
$status &= ~self::UNREAD;
} else {
$status |= self::UNREAD;
2013-03-23 16:24:35 +04:00
}
return $status;
}
2013-01-27 07:15:53 +04:00
}