diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-08-05 15:49:25 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-08-05 15:49:25 -0400 |
commit | 12720ebd14f299237fb16858c075436cfa9d55ee (patch) | |
tree | 3cf5121e6e0c3f793ced4dd283346e10782efb52 /lib | |
parent | 5225272b1cb1c34cc00525e4e05071a663fdd1e5 (diff) |
refactores code of the opml importer
Diffstat (limited to 'lib')
-rw-r--r-- | lib/feed.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/feed.php b/lib/feed.php index 6b1409440..496faa224 100644 --- a/lib/feed.php +++ b/lib/feed.php @@ -20,10 +20,14 @@ class OC_News_Feed extends OC_News_Collection { private $items; //array that contains all the items of the feed private $favicon; - public function __construct($url, $title, $items, $id = null) { + // 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, $items = null, $id = null) { $this->url = $url; $this->title = $title; - $this->items = $items; + if ($items !== null) { + $this->items = $items; + } if ($id !== null) { parent::__construct($id); } |