/** * Get the client's area alert level. * * @return Dodona\Alert */ public function areaStatus($check_category_id) { $result = Alert::find(Alert::BLUE); $services = $this->enabledServices(); foreach ($services as $service) { $status = $this->_pickStatusArea($service, $check_category_id); if ($status->id === Alert::RED) { $result = Alert::find(Alert::RED); break; } if ($status->id === Alert::AMBER) { $result = Alert::find(Alert::AMBER); } if ($status->id === Alert::GREEN && $result->id === Alert::BLUE) { $result = Alert::find(Alert::GREEN); } } return $result; }
/** * Initialise the result for the areaStatus. * * @param integer $count * @return Dodona\Alert */ private function _initializeAreaResult($count) { if ($count > 0) { $result = Alert::find(Alert::GREEN); } else { $result = Alert::find(Alert::BLUE); } return $result; }