<?php

namespace ModulesGarden\HostingQuotaNotifications\App\UI\TicketTemplates\Fields;

use \ModulesGarden\HostingQuotaNotifications\Core\UI\Widget\Forms\Fields\BaseField;

/**
 * Description of AdiaField
 *
 * @author Artur Pilch <artur.pi@modulesgarden.com>
 */
class AccordingAriaField extends BaseField
{
    //use \ModulesGarden\HostingQuotaNotifications\Core\UI\Traits\Description;
    protected $name  = 'accordingAriaField';
    protected $id    = 'accordingAriaField';
    protected $title = 'accordingAriaField';
    protected $class = ['info'];
    protected $vars  = [];
    protected $vueAria;

    public function getList()
    {

        //return $this->list;

        return $this->vars;
    }

    public function setVueAria($vueAria)
    {
        $this->vueAria = $vueAria;
        return $this;
    }

    public function getVueAria()
    {
        return $this->vueAria;
    }

    public function serVariables($vars)
    {
        $this->vars = $vars;
        return $this;
    }

    public function getParseViewValue($name)
    {
        $newName = '';
        $names   = explode('_', $name);
        
        foreach ($names as $name)
        {
            if(strtolower($name) == 'whmcs')
            {
                $name = strtoupper($name);
            }
            $newName = $newName . ucfirst($name) . ' ';
        }
        return trim($newName, ' ');
    }

    public function getParseValue($name)
    {
        return '{$' . $name . '}';
    }
}
