<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Authenticatable;
use DB;

class Etablissement extends Model {
	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'etablissements';


	//getNB Etablissements
	public function getVoiesAttribute() {
		$txt="";
		if($this->voie_generale) $txt.="Générale";
		if($this->voie_technologique) $txt.=(($txt!="")?"<br/>":"")."Technologique";
		if($this->voie_professionnelle) $txt.=(($txt!="")?"<br/>":"")."Professionnelle";

		return $txt;
	}

}