summaryrefslogtreecommitdiffstats
path: root/lib/Db
diff options
context:
space:
mode:
authorDaniel Schaal <daniel@schaal.email>2017-01-04 11:09:46 +0100
committerBernhard Posselt <BernhardPosselt@users.noreply.github.com>2017-01-04 11:09:46 +0100
commit04f66c9710faf9438adcc69028eed082c98a5178 (patch)
tree3e11906b5e318b0fdddccfe6e8b9d30af44dcb0f /lib/Db
parent41932775bcf79d5f80060e87b5051bd9b5937c5f (diff)
Add updatedDate to item model (#81)
* Update picoFeed to v0.1.28 * Add updated_date to database and bump version to 10.1.1 * Add updatedDate to item model * Check for updatedDate when updating a feed * Fix unit test to check for newer updatedDate
Diffstat (limited to 'lib/Db')
-rw-r--r--lib/Db/Item.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Db/Item.php b/lib/Db/Item.php
index 943002c32..f19843c8e 100644
--- a/lib/Db/Item.php
+++ b/lib/Db/Item.php
@@ -57,6 +57,7 @@ class Item extends Entity implements IAPI, \JsonSerializable {
protected $title;
protected $author;
protected $pubDate;
+ protected $updatedDate;
protected $body;
protected $enclosureMime;
protected $enclosureLink;
@@ -69,6 +70,7 @@ class Item extends Entity implements IAPI, \JsonSerializable {
public function __construct() {
$this->addType('pubDate', 'integer');
+ $this->addType('updatedDate', 'integer');
$this->addType('feedId', 'integer');
$this->addType('status', 'integer');
$this->addType('rtl', 'boolean');
@@ -122,6 +124,7 @@ class Item extends Entity implements IAPI, \JsonSerializable {
'title' => $this->getTitle(),
'author' => $this->getAuthor(),
'pubDate' => $this->getPubDate(),
+ 'updatedDate' => $this->getUpdatedDate(),
'body' => $this->getBody(),
'enclosureMime' => $this->getEnclosureMime(),
'enclosureLink' => $this->getEnclosureLink(),
@@ -144,6 +147,7 @@ class Item extends Entity implements IAPI, \JsonSerializable {
'title' => $this->getTitle(),
'author' => $this->getAuthor(),
'pubDate' => $this->getPubDate(),
+ 'updatedDate' => $this->getUpdatedDate(),
'body' => $this->getBody(),
'enclosureMime' => $this->getEnclosureMime(),
'enclosureLink' => $this->getEnclosureLink(),
@@ -164,6 +168,7 @@ class Item extends Entity implements IAPI, \JsonSerializable {
'title' => $this->getTitle(),
'author' => $this->getAuthor(),
'pubDate' => $this->getPubDate(),
+ 'updatedDate' => $this->getUpdatedDate(),
'body' => $this->getBody(),
'enclosureMime' => $this->getEnclosureMime(),
'enclosureLink' => $this->getEnclosureLink(),
@@ -186,6 +191,7 @@ class Item extends Entity implements IAPI, \JsonSerializable {
$item->setTitle($import['title']);
$item->setAuthor($import['author']);
$item->setPubDate($import['pubDate']);
+ $item->setUpdatedDate($import['updatedDate']);
$item->setBody($import['body']);
$item->setEnclosureMime($import['enclosureMime']);
$item->setEnclosureLink($import['enclosureLink']);