<?php

declare(strict_types=1);

namespace KupShop\ReturnsBundle\Email;

use KupShop\KupShopBundle\Email\UserMessagesInterface;
use KupShop\KupShopBundle\Email\UserMessagesTrait;

class ReturnMessageEmail extends ReturnEmail implements UserMessagesInterface
{
    use UserMessagesTrait;

    protected static $name = 'Zprávy uživatelům';
    protected static $type = 'RETURN_MESSAGE';
    protected static $priority = 1;

    public function getMessages($languageID = null): array
    {
        if (!$languageID && $this->return) {
            $languageID = $this->return->getIdLanguage();
        }

        return $this->fetchMessages($languageID);
    }

    public function getObjectId(): ?int
    {
        return $this->return->getId();
    }
}
