/** * Devuelve el nombre del estado * * @param EventInterface $item * @param null $state * @return bool|string */ public static function getStateName(EventInterface $item, $state = null) { $state = is_null($state) ? $item->getState() : intval($state); switch ($item->getType()) { case Event::TYPE_HOST: return Language::t(EventStateHost::getStateName($state)); case Event::TYPE_SERVICE: return Language::t(EventStateService::getStateName($state)); case Event::TYPE_TRIGGER: return Language::t(EventStateTrigger::getStateName($state)); } return false; }
/** * Comprobar si el evento supera el nivel mínimo para mostrarlo * * @param EventInterface $item * @return bool */ private function getFilterLevel(EventInterface $item) { if (null !== $item->getBackendLevel() && $item->getState() < $item->getBackendLevel()) { $item->setFilterStatus('Backend level'); return true; } return false; }