<?php

namespace ModulesGarden\HostingQuotaNotifications\App\Libs\TicketTemplatesLangs;

use \ModulesGarden\HostingQuotaNotifications\App\Models\TicketTemplatesLangs;


use \ModulesGarden\HostingQuotaNotifications\Core\Models\Whmcs;

/**
 * Description of Manage
 *
 * @author Artur Pilch <artur.pi@modulesgarden.com>
 */
class Manage
{
    public static function getTemplateLangs($id)
    {
        return TicketTemplatesLangs::where('template_id', '=', $id)->get();
    }
    
    public static function delete($id)
    {
        TicketTemplatesLangs::where('id', '=', $id)->delete();
    }

    public static function deleteWhereTemplateId($templateid)
    {
        TicketTemplatesLangs::where('template_id', '=', $templateid)->delete();
    }
    
    public static function getTemplateLang($id, $lang)
    {
        return TicketTemplatesLangs::where('template_id', '=', $id)->where('lang', '=', $lang)->first();
    }

    public static function getUsedLangsForTemplate($templateIid, $id)
    {
        return TicketTemplatesLangs::select('lang')->where('template_id', '=', $templateIid)->where('id', '!=', $id)->get();
    }
}
