diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-01-27 04:15:53 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-01-27 04:15:53 +0100 |
commit | ae7393db3d99a7ac223ae917129cccd9f49888e3 (patch) | |
tree | 7f54b72b0d01c38afd1378365a67e4f192922423 /db/folder.php | |
parent | 483784caa38bd6131405ac474347a215584e30a5 (diff) |
merged the angularjs branch
Diffstat (limited to 'db/folder.php')
-rw-r--r-- | db/folder.php | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/db/folder.php b/db/folder.php new file mode 100644 index 000000000..2e3c96a7c --- /dev/null +++ b/db/folder.php @@ -0,0 +1,76 @@ +<?php +/** +* ownCloud - News app +* +* @author Alessandro Cosentino +* Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com> +* +* This file is licensed under the Affero General Public License version 3 or later. +* See the COPYING-README file +* +*/ + +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 getParentId() { + if ($this->parent === null) { + return 0; + } + return $this->parent->getId(); + } + + public function addChild(Collection $child) { + $this->children[] = $child; + } + + public function addChildren($children) { + $this->children = $children; + } + + public function getChildren() { + return $this->children; + } + + + +}
\ No newline at end of file |