From e583df60d3c77d4e7f64a889b8951907c594b922 Mon Sep 17 00:00:00 2001 From: Alessandro Cosentino Date: Thu, 7 Jun 2012 16:19:25 -0400 Subject: creates a superclass collection for feeds and folders --- lib/folder.php | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'lib/folder.php') diff --git a/lib/folder.php b/lib/folder.php index 6c7c4c2f5..2bdc1fb78 100644 --- a/lib/folder.php +++ b/lib/folder.php @@ -23,18 +23,18 @@ /** * This class models a folder that contains feeds. */ -class OC_News_Folder { +class OC_News_Folder extends OC_News_Collection { private $name; - private $id; - private $feeds; private $children; private $parent; public function __construct($name, $parent = null){ $this->name = $name; - $this->parent = $parent; - $this->feeds = array(); + $this->children = array(); + if ($parent !== null){ + $this->parent = $parent; + } } public function getName(){ @@ -45,23 +45,15 @@ class OC_News_Folder { $this->name = $name; } - public function getId(){ - return $this->id; - } - - public function setId($id){ - $this->id = $id; - } - public function getParentId(){ - if ($this->parent == null){ + if ($this->parent === null){ return 0; } return $this->parent->getId(); } - public function addFeed(OC_News_Feed $feed){ - $this->feeds[] = $feed; + public function addChild(OC_News_Collection $child){ + $this->children[] = $child; } } \ No newline at end of file -- cgit v1.2.3