<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Utils\StatusMessages;

class HTMLStatusMessage implements StatusMessage
{
  protected $msgBoxType;
  protected $message;

  
  public function __construct(int $pMsgBoxType, string $pMessage)
  {
    $this->msgBoxType = $pMsgBoxType;
    $this->message = $pMessage;
  }

  public function getMessageBoxType(): int
  {
    return $this->msgBoxType;
  }

  public function getStatusMessage(): string
  {
    return \CleanOperations::cleanStringContainingHtml($this->message);
  }

  
  public static function getErrorMessageObj($pMessage)
  {
    return new HTMLStatusMessage(static::MSG_BOX_ERROR, $pMessage);
  }

  public static function getSuccessMessageObj($pMessage)
  {
    return new HTMLStatusMessage(static::MSG_BOX_SUCCESS, $pMessage);
  }

  public static function getWarningMessageObj($pMessage)
  {
    return new HTMLStatusMessage(static::MSG_BOX_WARNING, $pMessage);
  }

  public static function getInfoMessageObj($pMessage)
  {
    return new HTMLStatusMessage(static::MSG_BOX_INFO, $pMessage);
  }
}