<?php

namespace GriffinForms\Admin\Html\FormControls\Form;

abstract class Format extends \GriffinForms\Admin\Html\FormControls\Format
{
    protected $lang;
    protected $choices;
    protected $sql;

    protected function isAppContext(): bool
    {
        return !empty($this->data['app_context']);
    }

    protected function getControlData(array $data = []): array
    {
        if ($this->isAppContext()) {
            $data['app_context'] = true;
        }

        return $data;
    }
    
    protected function setLang($type = null)
    {
        $this->lang = \GriffinForms\Admin\Language\Form::getInstance();
    }    
    
    protected function setChoices()
    {
        $this->choices = \GriffinForms\Admin\Choices\Form::getInstance();
    }    
    
    protected function setSql()
    {
        $this->sql = \GriffinForms\Admin\Sql\Form::getInstance();
    }
}
