<?php


namespace App\Models;

use App\Entities\Paciente\Paciente;
use App\Entities\Pergunta\Pergunta;
use App\Services\PacienteService;
use App\Services\PessoaService;
use App\Services\Service;
use App\Utils\ModelUtils;
use App\ViewModels\Paciente\PacienteRegistrationViewModel\PacienteRegistrationViewModel;
use CodeIgniter\Model;

// use phpDocumentor\Reflection\DocBlock\Tags\Var_;
class PerguntaModel extends ModelEntity {
	protected $table = 'pergunta';
	protected $primaryKey = 'id';
	protected $returnType = 'array';
	protected $allowedFields = [ 
			'texto_pergunta',
			'id_tipo_pergunta',
			'obrigatorio',
			'id_formulario',
			'ordem',
			'ativo'
	];
	protected $useSoftDeletes = false;
	protected $skipValidation = true;
	protected $useTimestamps = false;

	public function registerPergunta(Pergunta $pergunta) {

		$pergunta_data = $pergunta->toArray( true );
		$id_pergunta = $this->insert( $pergunta_data );
		$pergunta->setId( $id_pergunta ?? 0);

	}

}
