_messages[$message->getType()])) { $this->_messages[$message->getType()] = array(); } $this->_messages[$message->getType()][] = $message; return $this; } public function getMessages($type='') { if ('' == $type) { $arrRes = array(); foreach ($this->_messages as $messageType => $messages) { $arrRes = array_merge($arrRes, $messages); } return $arrRes; } return isset($this->_messages[$type]) ? $this->_messages[$type] : array(); } /** * Set or append a message to existing one * * @param string $message * @param bool $append * @return Mage_Core_Exception */ public function setMessage($message, $append = false) { if ($append) { $this->message .= $message; } else { $this->message = $message; } return $this; } }