*/
private $templateInstance = NULL;
- /**
- * Fatal resolved messages from filters and so on
- */
- private $fatalMessages = array();
-
/**
* Protected constructor
*
*/
public final function addFatalMessage ($messageId) {
// Adds the resolved message id to the fatal message list
- array_push($this->fatalMessages, $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId));
+ $this->addFatalMessagePlain($this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId));
}
/**
*/
public final function addFatalMessagePlain ($message) {
// Adds the resolved message id to the fatal message list
- array_push($this->fatalMessages, $message);
+ $this->pushValueToGenericArrayElement('fatal_messages', 'generic', 'message', $message);
}
/**
* @throws ResponseHeadersAlreadySentException Thrown if headers are
* already sent
*/
- public function flushBuffer ($force = false) {
- if ((headers_sent()) && ($force === false)) {
+ public function flushBuffer ($force = FALSE) {
+ if ((headers_sent()) && ($force === FALSE)) {
// Headers are already sent!
throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
} elseif (!headers_sent()) {
}
// Are there some error messages?
- if (count($this->fatalMessages) == 0) {
+ if ($this->countGenericArrayElements('fatal_messages', 'generic', 'message') == 0) {
// Flush the output to the world
$this->getWebOutputInstance()->output($this->responseBody);
} else {
// Display all error messages
- $this->getApplicationInstance()->handleFatalMessages($this->fatalMessages);
+ $this->getApplicationInstance()->handleFatalMessages($this->getGenericArrayKey('fatal_messages', 'generic', 'message'));
// Send the error messages out to the world
$this->getWebOutputInstance()->output($this->responseBody);