<?php

namespace KupShop\AdminBundle\Admin\Actions;

class ActionResult
{
    /** @var bool */
    private $successful;

    /** @var string */
    private $msg;

    private $redirect;

    private ?string $HTMLMessage = null;

    public function __construct(
        bool $successful,
        ?string $msg = null,
    ) {
        $this->successful = $successful;
        $this->msg = $msg;
    }

    public function isSuccessful(): bool
    {
        return $this->successful;
    }

    public function getMsg(): ?string
    {
        return $this->msg;
    }

    public function setRedirect(?array $params)
    {
        $this->redirect = $params;

        return $this;
    }

    public function getRedirect()
    {
        return $this->redirect;
    }

    public function setHTMLMessage(?string $HTMLMessage): self
    {
        $this->HTMLMessage = $HTMLMessage;

        return $this;
    }

    public function getHTMLMessage(): ?string
    {
        return $this->HTMLMessage;
    }
}
