<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace ModulesGarden\HostingQuotaNotifications\App\Helper;

use ModulesGarden\HostingQuotaNotifications\App\Libs\Cron\Notifications\Actions\SendNotification;
use \ModulesGarden\HostingQuotaNotifications\Core\Helper as CoreHelper;
use \ModulesGarden\HostingQuotaNotifications\Core\Api\Whmcs as WhmcsApi;
use ModulesGarden\HostingQuotaNotifications\App\Helper\Modules\Multibrand;

/**
 * Description of Api
 *
 * @author Artur Pilch <artur.pi@modulesgarden.com>
 */
class Api {
        
    static function apiCall($command, $params, $adminUserName = null)
    {
        if(Multibrand::isActive() && $command == SendNotification::SENDEMAIL)
        {
            Multibrand::updateVars($command, $params);
        }

        return CoreHelper\di(WhmcsApi::class)->call($command, $params, $adminUserName);
    }
}
