<?php

namespace GriffinForms\Frontend\Actions;

class Format extends \GriffinForms\Frontend\Format
{
    protected $sql;
    protected $data;
    protected $form = null;

    protected function setSql()
    {
        $sql_class = '\GriffinForms\Frontend\Sql\\' . $this->meta;
        $this->sql = $sql_class::getInstance();
    }

    protected function setForm()
    {
        if (isset($this->data['form']) and $this->sql->itemExists('form', $this->data['form'])) {
            $this->form = new \GriffinForms\Items\Form();
            $this->form->loadItem($this->data['form']);
        };
    }

    public function runActions()
    {

    }

    public function runResponse()
    {
        return false;
    }

    public function __construct($submission_data)
    {
        $this->data = $submission_data;
        $this->setAll();
    }
}