summaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-10-24 21:38:30 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-10-24 21:38:30 +0200
commit52564957e6b25b4f127666da79d27eb99ca9bd5e (patch)
treee4d2a7a77ee1ef17e54e59b55d37e837dfaf1821 /app/Models
parent72430fd36d04a3eb2397131f6573a9d630158205 (diff)
parentab11b333b4c37f6765316ab6214cd356e2574be6 (diff)
Add a visual alert on categories
By @aledeg https://github.com/FreshRSS/FreshRSS/pull/984 https://github.com/FreshRSS/FreshRSS/pull/983
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/Category.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/Models/Category.php b/app/Models/Category.php
index 37cb44dc3..9a44a2d09 100644
--- a/app/Models/Category.php
+++ b/app/Models/Category.php
@@ -6,6 +6,7 @@ class FreshRSS_Category extends Minz_Model {
private $nbFeed = -1;
private $nbNotRead = -1;
private $feeds = null;
+ private $hasFeedsWithError = false;
public function __construct($name = '', $feeds = null) {
$this->_name($name);
@@ -16,6 +17,7 @@ class FreshRSS_Category extends Minz_Model {
foreach ($feeds as $feed) {
$this->nbFeed++;
$this->nbNotRead += $feed->nbNotRead();
+ $this->hasFeedsWithError |= $feed->inError();
}
}
}
@@ -51,12 +53,17 @@ class FreshRSS_Category extends Minz_Model {
foreach ($this->feeds as $feed) {
$this->nbFeed++;
$this->nbNotRead += $feed->nbNotRead();
+ $this->hasFeedsWithError |= $feed->inError();
}
}
return $this->feeds;
}
+ public function hasFeedsWithError() {
+ return $this->hasFeedsWithError;
+ }
+
public function _id($value) {
$this->id = $value;
}