public function getMessages($format = self::Format_Array)
    {
        $messages = array();

        // Collect the messages.
        if (($message = $this->getExceptionMessage()) !== '') {
            $messages[] = $message;
        }
        $messages = array_merge($messages, $this->getErrors(self::Format_PlainTextArray));
        $messages = array_merge($messages, $this->getWarnings(self::Format_PlainTextArray));
        $messages = array_merge($messages, $this->getNotices(self::Format_PlainTextArray));

        return $this->formatMessages($messages, $format);
    }