. * */ namespace OCA\News\Db; class Item extends Entity { public $guidHash; public $guid; public $url; public $title; public $author; public $pubDate; public $body; public $enclosureMime; public $enclosureLink; public $feedId; public $status; public $feedTitle; public function setRead() { $this->markFieldUpdated('status'); $this->status &= ~StatusFlag::UNREAD; } public function isRead() { return !(($this->status & StatusFlag::UNREAD) === StatusFlag::UNREAD); } public function setUnread() { $this->markFieldUpdated('status'); $this->status |= StatusFlag::UNREAD; } public function isUnread() { return !$this->isRead(); } public function setStarred() { $this->markFieldUpdated('status'); $this->status |= StatusFlag::STARRED; } public function isStarred() { return ($this->status & StatusFlag::STARRED) === StatusFlag::STARRED; } public function setUnstarred() { $this->markFieldUpdated('status'); $this->status &= ~StatusFlag::STARRED; } public function isUnstarred() { return !$this->isStarred(); } } /*class Item { private $url; private $title; private $guid; private $body; private $status; //a bit-field set with status flags private $id; //id of the item in the database table private $author; private $date; //date is stored in the Unix format private $feedTitle; private $enclosure; // Enclosure object containing media attachment information public function __construct($url, $title, $guid, $body, $id = null) { $this->title = $title; $this->url = $url; $this->guid = $guid; $this->body = $body; $this->enclosure = false; if ($id == null) { $this->status |= StatusFlag::UNREAD; } else { $this->id = $id; } } public function getBody() { return $this->body; } public function setBody($body) { $this->body = $body; } public function getAuthor() { return $this->author; } public function setAuthor($author) { $this->author = $author; } public function getDate() { return $this->date; } //TODO: check if the parameter is in the Unix format public function setDate($date) { $this->date = $date; } public function getEnclosure() { return $this->enclosure; } public function setEnclosure(Enclosure $enclosure) { $this->enclosure = $enclosure; } } */