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

class Terms extends Generic
{
	protected $primaryKey = 'id';
    protected $table = 'terms';
    protected $fillable = ['id', 'name', 'studentsperjudge', 'start', 'end', 'location', 'srprojecturl', 'srprojecttoken', 'allowjudgestologin', 'mapimage', 'active', 'created', 'lastupdated', 'statsrefreshrate', 'studentscangrades', 'liveurl', 'devurl', 'order', 'deadline'];

    public function getActiveTerm()
    {
        return $this::where('active', '=', 1)->get()[0];
    }
}