From 9132f6a27d8f26bfbf333a3d6d36361d1e0a2fa3 Mon Sep 17 00:00:00 2001 From: Alessandro Cosentino Date: Thu, 16 Aug 2012 01:13:16 -0400 Subject: saves and shows datetime of items --- lib/item.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib/item.php') diff --git a/lib/item.php b/lib/item.php index acef41c92..e64eaa044 100644 --- a/lib/item.php +++ b/lib/item.php @@ -33,7 +33,8 @@ class Item { private $status; //a bit-field set with status flags private $id; //id of the item in the database table private $author; - + private $date; //date is stored in the Unix format + public function __construct($url, $title, $guid, $body, $id = null){ $this->title = $title; $this->url = $url; @@ -98,6 +99,10 @@ class Item { public function setStatus($status){ $this->status = $status; } + + /* change the following method with set/get magic methods + * http://www.php.net/manual/en/language.oop5.overloading.php#object.get + */ public function getTitle(){ return $this->title; @@ -130,4 +135,13 @@ class Item { public function setAuthor($author){ $this->author = $author; } + + public function getDate(){ + return $this->date; + } + + //TODO: check if the parameter is in the Unix format + public function setDate($date){ + $this->date = $date; + } } -- cgit v1.2.3