<?php

namespace GriffinForms\Admin\Html\Elements\Submission;

class Format extends \GriffinForms\Admin\Html\Format
{
    protected $sql;
    protected $lang;
    protected $field;
    protected $field_value;
    protected $input_class = 'gf-submission-value-block';
    protected $context = array();

    protected function setSql()
    {
        $this->sql = \GriffinForms\Admin\Sql\Submission::getInstance();
    }

    protected function setLang($type = null)
    {
        $this->lang = \GriffinForms\Admin\Language\Submission::getInstance();
    }

    protected function setFieldValue()
    {
        $this->field_value = ($this->field_value) ? $this->field_value : '<em class="text-secondary small">' . __('No value entered', 'griffinforms-form-builder') . '</em>';
    }

    protected function setContext()
    {
        $this->context = is_array($this->context) ? $this->context : array();
    }

    public function __construct($field, $field_value = [], $context = [])
    {
        $this->field = $field;
        $this->field_value = $field_value;
        $this->context = $context;
        $this->setAll();
    }
}
