From 3d3618d97c7ef1fbfe2a45218237ccdcd4396d7d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 12 Mar 2013 18:20:41 +0100 Subject: Correction bug gestion de l'id pour Feed et Entry --- app/models/Feed.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'app/models/Feed.php') diff --git a/app/models/Feed.php b/app/models/Feed.php index 67874925f..db051c948 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -1,6 +1,7 @@ url . Configuration::selApplication ()); + if(is_null($this->id)) { + return small_hash ($this->url . Configuration::selApplication ()); + } else { + return $this->id; + } } public function url () { return $this->url; @@ -45,7 +50,10 @@ class Feed extends Model { $feedDAO = new FeedDAO (); return $feedDAO->countEntries ($this->id ()); } - + + public function _id ($value) { + $this->id = $value; + } public function _url ($value) { if (!is_null ($value) && !preg_match ('#^https?://#', $value)) { $value = 'http://' . $value; @@ -294,6 +302,10 @@ class HelperFeed { $list[$key]->_website ($dao['website']); $list[$key]->_description ($dao['description']); $list[$key]->_lastUpdate ($dao['lastUpdate']); + + if (isset ($dao['id'])) { + $list[$key]->_id ($dao['id']); + } } return $list; -- cgit v1.2.3