_init('wsalogger/log'); } /** * Retrieve Severity collection array * * @return array|string */ public function getSeverities($severity = null) { $severities = array( self::SEVERITY_CRITICAL => Mage::helper('adminnotification')->__('critical'), self::SEVERITY_MAJOR => Mage::helper('adminnotification')->__('warning'), self::SEVERITY_MINOR => Mage::helper('adminnotification')->__('info'), self::SEVERITY_NOTICE => Mage::helper('adminnotification')->__('debug'), self::SEVERITY_NONE => Mage::helper('adminnotification')->__('DISABLED') ); if (!is_null($severity)) { if (isset($severities[$severity])) { return $severities[$severity]; } return null; } return $severities; } /** * Retrieve Latest Notice * * @return Mage_AdminNotification_Model_Inbox */ public function loadLatestNotice() { $this->setData(array()); $this->getResource()->loadLatestNotice($this); return $this; } /** * Retrieve notice statuses * * @return array */ public function getNoticeStatus() { return $this->getResource()->getNoticeStatus($this); } /** * Parse and save new data * * @param array $data * @return Mage_AdminNotification_Model_Inbox */ public function parse($severity,$extension,$title,$description,$code=0,$url='') { if (is_array($description) || is_object($description)) { $description = print_r($description, true); } $feedData[] = array( 'severity' => $severity, 'date_added' => gmdate('Y-m-d H:i:s'), 'extension' => $extension, 'title' => $title, 'description' => $description, 'code' => $code, 'url' => $url ); return $this->getResource()->parse($this, $feedData); } public function truncate() { return $this->getResource()->truncate(); } }