Viewing File: /usr/local/cpanel/whostmgr/docroot/cgi/ncssl/source/src/Exception/ActivateException.php

<?php

namespace App\Exception;

use App\Model\Message;

class ActivateException extends BaseException
{
    private const AVAILABLE_AREA_LIST = [
        Message::AREA_SSLS,
        Message::AREA_DEFAULT,
        Message::AREA_INSTALLED,
    ];

    /**
     * @var string[]
     */
    private array $areaList = [];

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

    /**
     * @param string $areaName
     *
     * @return $this
     */
    public function addArea(string $areaName): self
    {
        if (in_array($areaName, static::AVAILABLE_AREA_LIST)) {
            $this->areaList[] = $areaName;
        }

        return $this;
    }

    /**
     * @return string[]
     */
    public function getAreaList(): array
    {
        return $this->areaList;
    }

    /**
     * @return string|null
     */
    public function getMessageId(): ?string
    {
        return $this->messageId;
    }

    /**
     * @param string $messageId
     *
     * @return $this
     */
    public function setMessageId(string $messageId): self
    {
        $this->messageId = $messageId;

        return $this;
    }
}
Back to Directory File Manager