/** * Count the total alerts number of the application. */ public function countAlerts($status = null) { $countAlerts = 0; foreach ($this->modules as $module) { $countAlerts += $module->countAlerts($status); } foreach ($this->layouts as $layout) { $countAlerts += $layout->countAlerts($status); } foreach ($this->partials as $partial) { $countAlerts += $partial->countAlerts($status); } $countAlerts += parent::countAlerts($status); return $countAlerts; }
/** * Test if the module object itself has alerts. */ public function hasGenericAlerts($status = null) { return parent::countAlerts($status) > 0; }