|
@@ -1,6 +1,7 @@
|
|
|
<?php
|
|
<?php
|
|
|
|
|
|
|
|
class Feed extends Model {
|
|
class Feed extends Model {
|
|
|
|
|
+ private $id = null;
|
|
|
private $url;
|
|
private $url;
|
|
|
private $category = '';
|
|
private $category = '';
|
|
|
private $entries = null;
|
|
private $entries = null;
|
|
@@ -14,7 +15,11 @@ class Feed extends Model {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function id () {
|
|
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 () {
|
|
public function url () {
|
|
|
return $this->url;
|
|
return $this->url;
|
|
@@ -45,7 +50,10 @@ class Feed extends Model {
|
|
|
$feedDAO = new FeedDAO ();
|
|
$feedDAO = new FeedDAO ();
|
|
|
return $feedDAO->countEntries ($this->id ());
|
|
return $feedDAO->countEntries ($this->id ());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public function _id ($value) {
|
|
|
|
|
+ $this->id = $value;
|
|
|
|
|
+ }
|
|
|
public function _url ($value) {
|
|
public function _url ($value) {
|
|
|
if (!is_null ($value) && !preg_match ('#^https?://#', $value)) {
|
|
if (!is_null ($value) && !preg_match ('#^https?://#', $value)) {
|
|
|
$value = 'http://' . $value;
|
|
$value = 'http://' . $value;
|
|
@@ -294,6 +302,10 @@ class HelperFeed {
|
|
|
$list[$key]->_website ($dao['website']);
|
|
$list[$key]->_website ($dao['website']);
|
|
|
$list[$key]->_description ($dao['description']);
|
|
$list[$key]->_description ($dao['description']);
|
|
|
$list[$key]->_lastUpdate ($dao['lastUpdate']);
|
|
$list[$key]->_lastUpdate ($dao['lastUpdate']);
|
|
|
|
|
+
|
|
|
|
|
+ if (isset ($dao['id'])) {
|
|
|
|
|
+ $list[$key]->_id ($dao['id']);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return $list;
|
|
return $list;
|