<?php

namespace App;
use Session;
use Illuminate\Database\Eloquent\Model;

class Jury extends Model
{
    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $connection;
    public function __construct(){
        $this->connection = session::get('gestjury_database') ;
    }

    protected $table = 'gestjury_jury';

    /**
    * The database primary key value.
    *
    * @var string
    */
    protected $primaryKey = 'id';

    /**
     * Attributes that should be mass-assignable.
     *
     * @var array
     */
    protected $fillable = [
        'id_filiere',
        'option',
        'president',
        'maitre_memoire',
        'sujet',
        'id_salle',
        'date',
        'heure_debut',
        'type_numero'
    ];

    public function gestjury_membre_jury()
    {
        return $this->belongsTo('App\MembreJury');
    }
    public function gestjury_salle()
    {
        return $this->belongsTo('App\Salle');
    }
    
}
