summaryrefslogtreecommitdiffstats
path: root/db/feed.php
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-20 16:28:41 +0100
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-20 16:29:30 +0100
commit85ba81650ba49798a817403ef815ee8eae77820e (patch)
tree4324a65ae76d22f6ee06976a44d42c8626806c8f /db/feed.php
parent46a7c39bcb7b5ac18dff552fafb7d75e1ef27803 (diff)
ported entities
Diffstat (limited to 'db/feed.php')
-rw-r--r--db/feed.php102
1 files changed, 29 insertions, 73 deletions
diff --git a/db/feed.php b/db/feed.php
index eda225302..69f62b765 100644
--- a/db/feed.php
+++ b/db/feed.php
@@ -1,86 +1,42 @@
<?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 file is licensed under the Affero General Public License version 3 or later.
-* See the COPYING-README file
+* 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.
+*
+* 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/>.
*
*/
-namespace OCA\News;
-
-
-/**
- * This class models a feed.
- */
-class Feed extends Collection {
-
- private $title;
- private $url;
- private $items; //array that contains all the items of the feed
- private $favicon;
-
- // if $items = null, it means that feed has not been fetched yet
- // if $id = null, it means that the feed has not been stored in the db yet
- public function __construct($url, $title = null, $items = null, $id = null) {
- $this->url = $url;
- $this->title = $title;
- if ($items !== null) {
- $this->items = $items;
- }
- if ($id !== null) {
- parent::__construct($id);
- }
- }
-
- public function getUrl() {
- return $this->url;
- }
-
- public function getTitle() {
- return $this->title;
- }
-
- public function setTitle($title) {
- $this->title = $title;
- }
-
- public function getFavicon() {
- return $this->favicon;
- }
-
- public function setFavicon($favicon) {
- $this->favicon = $favicon;
- }
+namespace OCA\News\Db;
- public function setItems($items) {
- $this->items = $items;
- }
+use \OCA\AppFramework\Db\Entity;
- public function getItems() {
- return $this->items;
- }
- public function setFolderId($folderId){
- $this->folderId = $folderId;
- }
+class Feed extends Entity {
- public function getFolderId(){
- return $this->folderId;
- }
-
- public function jsonSerialize(){
- //TODO: this is just for test
- $encoding = array(
- 'id' => $this->getId(),
- 'url' => $this->getUrl(),
- 'title' => $this->getTitle(),
- 'folderId' => $this->getFolderId()
- );
- return $encoding;
- }
+ public $userId;
+ public $urlHash;
+ public $url;
+ public $title;
+ public $faviconLink;
+ public $added;
+ public $lastmodified;
+ public $folderId;
-}
+} \ No newline at end of file