check if notifications exist at all

This commit is contained in:
Sebastian Grewe 2013-06-07 20:15:23 +02:00
parent d20efb3caa
commit 9eeb088734

View File

@ -46,7 +46,8 @@ if (empty($aWorkers)) {
// We notified, lets check which recovered // We notified, lets check which recovered
$aNotifications = $notification->getAllActive(); $aNotifications = $notification->getAllActive();
foreach ($aNotifications as $aNotification) { if (!empty($aNotifications)) {
foreach ($aNotifications as $aNotification) {
$aData = json_decode($aNotification['data'], true); $aData = json_decode($aNotification['data'], true);
$aWorker = $worker->getWorker($aData['id']); $aWorker = $worker->getWorker($aData['id']);
if ($aWorker['active'] == 1) { if ($aWorker['active'] == 1) {
@ -56,6 +57,6 @@ foreach ($aNotifications as $aNotification) {
verbose("Failed to set notification inactive for " . $aWorker['username'] . "\n"); verbose("Failed to set notification inactive for " . $aWorker['username'] . "\n");
} }
} }
}
} }
?> ?>