<?php
/**
 * Created by PhpStorm.
 * User: matiss.bisofs
 * Date: 25/09/2017
 * Time: 16:38
 */

namespace Mtc\Modules\FormBuilder\Classes;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Schema;

class FormQuestionEmail extends Model
{

    protected $table = 'forms_questions_emails';

    public $timestamps = false;

    /**
     * FormQuestionEmail::getEmpty().
     *
     * Creates a dummy data array for Vue to process.
     * Eloquent doesn't give out object columns unless it is saved.
     * This function gets object columns and adds relations as empty arrays;
     *
     * @access public
     * @static
     * @return array $empty Empty array with object attributes as keys
     */
    public static function getEmpty()
    {
        $temp = new self();
        $empty = Schema::getColumnListing($temp->getTable());
        $empty = array_fill_keys($empty, '');
        return $empty;
    }

}