/**
  * Add a system message.
  * This is a callback method for signal receivers.
  *
  * @param string $text The text to be displayed
  * @param string $status The status of this system message
  * @param int $count Will be added to the total count
  * @param string $module The associated module
  */
 public function addSystemMessage($text, $status = InformationStatus::STATUS_OK, $count = 0, $module = '')
 {
     $this->totalCount += (int) $count;
     /** @var InformationStatus $messageSeverity */
     $messageSeverity = InformationStatus::cast($status);
     // define the severity for the badge
     if ($messageSeverity->isGreaterThan($this->highestSeverity)) {
         $this->highestSeverity = $messageSeverity;
     }
     $this->systemMessages[] = array('module' => $module, 'count' => (int) $count, 'status' => $messageSeverity, 'text' => $text);
 }
 /**
  * Emits the "loadMessages" signal
  *
  * @return void
  */
 protected function emitLoadMessages()
 {
     // @internal This API is subject to be rebuilt from scratch anytime. Do not use in extensions!
     list($message) = $this->getSignalSlotDispatcher()->dispatch(__CLASS__, 'loadMessages', array(array()));
     if (empty($message)) {
         return;
     }
     // increase counter
     if (isset($message['count'])) {
         $this->totalCount += (int) $message['count'];
     }
     /** @var InformationStatus $messageSeverity */
     $messageSeverity = InformationStatus::cast($message['status']);
     // define the severity for the badge
     if ($messageSeverity->isGreaterThan($this->highestSeverity)) {
         $this->highestSeverity = $messageSeverity;
     }
     $this->systemMessages[] = $message;
 }