aboutsummaryrefslogtreecommitdiff
path: root/app/models/Feed.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-12 18:20:41 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-12 18:20:41 +0100
commit3d3618d97c7ef1fbfe2a45218237ccdcd4396d7d (patch)
tree8d053eaf738373b4c39243764f19b1419f7932a0 /app/models/Feed.php
parentb0a9ce799013b322f7480b75e98f7dcd038d530e (diff)
Correction bug gestion de l'id pour Feed et Entry
Diffstat (limited to 'app/models/Feed.php')
-rw-r--r--app/models/Feed.php16
1 files changed, 14 insertions, 2 deletions
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 @@
<?php
class Feed extends Model {
+ private $id = null;
private $url;
private $category = '';
private $entries = null;
@@ -14,7 +15,11 @@ class Feed extends Model {
}
public function id () {
- return small_hash ($this->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;