<?php
/**
 * Created by IntelliJ IDEA.
 * User: DennysO
 * Date: 6/3/2015
 * Time: 11:10 AM
 */
require_once "generic.php";

class Questions extends Generic
{
	protected $primaryKey = 'id';
    protected $table = 'questions';
    protected $fillable = ['id', 'text', 'created', 'valud', 'enabled', 'order', 'lastupdated'];

    public function getActiveQuestions()
    {
        $termid = (new Terms())->getActiveTerm()->id;
        $table = new Questions();
        $table = $table->select('id', 'text', 'value', 'enabled')
			           ->where('enabled', 1)
			           ->orderBy('order', 'ASC')
			           ->get();

        return $table;
    }
}