summaryrefslogtreecommitdiffstats
path: root/db/folder.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/folder.php
parent46a7c39bcb7b5ac18dff552fafb7d75e1ef27803 (diff)
ported entities
Diffstat (limited to 'db/folder.php')
-rw-r--r--db/folder.php100
1 files changed, 24 insertions, 76 deletions
diff --git a/db/folder.php b/db/folder.php
index 5dfa738f3..aa5cf66a9 100644
--- a/db/folder.php
+++ b/db/folder.php
@@ -1,90 +1,38 @@
<?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/>.
*
*/
-namespace OCA\News;
-
-/**
- * This class models a folder that contains feeds.
- */
-class Folder extends Collection {
-
- private $name;
- private $children;
- private $parent;
- private $opened;
-
- public function __construct($name, $id = null, Collection $parent = null) {
- $this->name = $name;
- if ($id !== null) {
- parent::__construct($id);
- }
- $this->children = array();
- if ($parent !== null) {
- $this->parent = $parent;
- }
- if($this->opened === null){
- $this->opened = true;
- }
- }
-
- public function getName() {
- return $this->name;
- }
-
- public function setName($name) {
- $this->name = $name;
- }
-
- public function getOpened() {
- return $this->opened;
- }
-
- public function setOpened($opened) {
- $this->opened = $opened;
- }
-
- public function setParentId() {
- if ($this->parent !== null) {
-
- }
- }
-
- public function getParentId() {
- if ($this->parent === null) {
- return 0;
- }
- return $this->parent->getId();
- }
+namespace OCA\News\Db;
- public function addChild(Collection $child) {
- $this->children[] = $child;
- }
+use \OCA\AppFramework\Db\Entity;
- public function addChildren($children) {
- $this->children = $children;
- }
- public function getChildren() {
- return $this->children;
- }
+class Folder extends Entity {
- public function jsonSerialize() {
- //TODO: this is just for test
- $encoding = array(
- 'id' => $this->getId(),
- 'parentId' => $this->getParentId(),
- 'title' => $this->getName(),
- );
- return $encoding;
- }
+ public $parentId;
+ public $name;
+ public $userId;
+ public $opened;
} \ No newline at end of file