summaryrefslogtreecommitdiffstats
path: root/lib/item.php
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-05-23 15:14:10 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-05-23 15:14:10 -0400
commitd8a193119f442c92bd47f150d149a5d1caf44a7e (patch)
tree4929cd74ec0489d8d8475fffca8620899a03ef84 /lib/item.php
parent97f76e8cc62ede53709539595e835c4900f44d0c (diff)
separates fetching/importing from the modelling classes
Diffstat (limited to 'lib/item.php')
-rw-r--r--lib/item.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/item.php b/lib/item.php
index 96fbf4f09..a5a49937c 100644
--- a/lib/item.php
+++ b/lib/item.php
@@ -35,25 +35,24 @@ class StatusFlag{
*/
class OC_News_Item {
- private $status; //a bit-field set with status flags
- private $spitem; //encapsulate a SimplePie_Item object
- private $itemid;
- private $title;
private $url;
+ private $title;
+ private $body;
+ private $status; //a bit-field set with status flags
+ private $id; //id of the item in the database table
- public function __construct(SimplePie_Item $spitem){
+ public function __construct($url, $title, $id = null){
+ $this->title = $title;
+ $this->url = $url;
$this->status |= StatusFlag::Unread;
- $this->spitem = $spitem;
- $this->title = $spitem->get_title();
- $this->url = $spitem->get_permalink();
}
public function getId(){
- return $this->itemid;
+ return $this->$id;;
}
public function setId($id){
- $this->itemid = $id;
+ $this->$id = $id;
}
public function setRead(){
@@ -72,7 +71,15 @@ class OC_News_Item {
return $this->title;
}
+ public function setTitle($title){
+ $this->title = $title;
+ }
+
public function getUrl(){
return $this->url;
}
+
+ public function setUrl($url){
+ $this->url = $url;
+ }
}