<?php
/**
 *
 * User: Artur Pilch <artur.pi@modulesgarden.com>
 * Date: 2018-08-06
 * Time: 14:21
 */

namespace ModulesGarden\HostingQuotaNotifications\App\Helper\Models;

use ModulesGarden\HostingQuotaNotifications\App\Libs\TicketTemplatesLangs\Manage as TicketTemplatesLangsManage;

class TicketTemplates
{
    public static function getTicketLanguage($userLang, $ticket_template)
    {
        $lang = TicketTemplatesLangsManage::getTemplateLang($ticket_template['id'], $userLang);
        if (!$lang)
        {
            $lang = TicketTemplatesLangsManage::getTemplateLang($ticket_template['id'], 'default');
        }
        return $lang ? $lang->toArray() : null;
    }
}