<?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\Models;


use ModulesGarden\HostingQuotaNotifications\App\Helper\Migration\Table;
use ModulesGarden\HostingQuotaNotifications\App\Helper\Tables;
use ModulesGarden\HostingQuotaNotifications\Core\Models\Whmcs\Client;
use ModulesGarden\HostingQuotaNotifications\Core\Models\Whmcs\Domain;
use \ModulesGarden\HostingQuotaNotifications\Core\Models\Whmcs\Hosting as HostingModel;
use ModulesGarden\HostingQuotaNotifications\Core\Models\Whmcs\Product;
use ModulesGarden\HostingQuotaNotifications\App\Helper\Pages\Services\Formatter;
use ModulesGarden\HostingQuotaNotifications\App\Models\Usage;

/**
 * Description of Hosting
 *
 * @author Artur Pilch <artur.pi@modulesgarden.com>
 */
class Hosting
{
    CONST URL = '<a href= "clientsservices.php?userid=%s&id=%s">%s #%s</a>';


    public static function getValueById($id, $value)
    {
        return HostingModel::where('id', '=', $id)->value($value);
    }

    public static function getHostingById($id)
    {
        return HostingModel::where('id', '=', $id)->get()->first();
    }

    public static function getServiceLimits($id)
    {
        return [
            'serviceBwLimit'          => self::getValueById($id, 'bwlimit'),
            'serviceDiskLimit'        => self::getValueById($id, 'disklimit'),
        ];
    }
}
