<?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\Models\HostingDuedates;
use \ModulesGarden\HostingQuotaNotifications\App\Models\Notifications;
use \ModulesGarden\HostingQuotaNotifications\App\Models\Usage;
use \ModulesGarden\HostingQuotaNotifications\Core\Models\Whmcs;

/**
 * Description of Tables
 *
 * @author Artur Pilch <artur.pi@modulesgarden.com>
 */
class Tables
{
    CONST HOSTING_DATES_VIEW = 'hostingDatesView';


    public static function tableNames($tableName = false)
    {
        $tableNames = [
            'hostingDueDates' => (new HostingDuedates())->getTable(),
            'notifications'   => (new Notifications())->getTable(),
            'usage'           => (new Usage())->getTable(),
            'hosting'         => (new Whmcs\Hosting())->getTable(),
            'product'         => (new Whmcs\Product())->getTable(),
            'invoiceItems'    => (new Whmcs\InvoiceItem())->getTable(),
            'invoices'        => (new Whmcs\Invoice())->getTable(),
            'hostingDatesView'  => 'hostingDatesView',
        ];
        return $tableName ? $tableNames[$tableName] : $tableNames;
    }

    public static function tableViewsNames($tableName = false)
    {
        $tableNames = [
            SELF::HOSTING_DATES_VIEW  => SELF::HOSTING_DATES_VIEW,
        ];
        return $tableName ? $tableNames[$tableName] : $tableNames;
    }
}
