summaryrefslogtreecommitdiffstats
path: root/lib/item.php
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-08-16 01:13:16 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-08-16 01:13:16 -0400
commit9132f6a27d8f26bfbf333a3d6d36361d1e0a2fa3 (patch)
treedafa0bd36324ebc801cf87780ea1efe8939f300e /lib/item.php
parent93ee15c1891aa52ebee8b46ca16f58d5dc7679ce (diff)
saves and shows datetime of items
Diffstat (limited to 'lib/item.php')
-rw-r--r--lib/item.php16
1 files changed, 15 insertions, 1 deletions
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;
+ }
}