original_string: public function setMessage($messages, $severity = 'info', $once = false)
      {
          if (!empty($messages)) {
              foreach (gplcart_array_flatten((array) $messages) as $message) {
                  if ($once) {
                      $this->session->setMessage($message, $severity);
                  } else {
                      $this->data['_messages'][$severity][] = $message;
                  }
              }
          }
      }
code: public function setMessage($messages, $severity = 'info', $once = false)
      {
          if (!empty($messages)) {
              foreach (gplcart_array_flatten((array) $messages) as $message) {
                  if ($once) {
                      $this->session->setMessage($message, $severity);
                  } else {
                      $this->data['_messages'][$severity][] = $message;
                  }
              }
          }
      }
code_tokens: public function setMessage ( $ messages , $ severity = 'info' , $ once = false ) { if ( ! empty ( $ messages ) ) { foreach ( gplcart_array_flatten ( ( array ) $ messages ) as $ message ) { if ( $ once ) { $ this -> session -> setMessage ( $ message , $ severity ) ; } else { $ this -> data [ '_messages' ] [ $ severity ] [ ] = $ message ; } } } }
docstring: Sets a message or an array of messages
  @param string|array $messages
  @param string $severity
  @param bool $once
docstring_tokens: Sets a message or an array of messages