<?php

namespace GriffinForms\Admin\Html\FormControls\Field;

abstract class Format extends \GriffinForms\Admin\Html\FormControls\Format
{
    protected $lang;
    protected $choices;
    protected $sql;
    protected $secure;
    
    protected function setLang($type = null)
    {
        $this->lang = \GriffinForms\Admin\Language\Field::getInstance();
    }    
    
    protected function setChoices()
    {
        $this->choices = \GriffinForms\Admin\Choices\Field::getInstance();
    }    
    
    protected function setSql()
    {
        $this->sql = \GriffinForms\Admin\Sql\Field::getInstance();
    }    
    
    protected function setSecure()
    {
        $this->secure = \GriffinForms\Admin\Secure\Field::getInstance();
    }
    
    protected function setValue()
    {
        $this->value = $this->secure->data($this->meta, $this->value);
    }
    
    protected function setSecureData()
    {
        $this->secure->setData(
            array(
                'field_type' => $this->data['field_type']
            )
        );
    }
}