- Fix vider la barre de recherche quand on clique sur "Réinitialiser" - Fix script index ElasticMedia + ajout condition sur l'existence d'un index - Ajout de la requete Elasticsearch dans MediaController
72 lines
1.3 KiB
PHP
72 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Sujet extends Model
|
|
{
|
|
|
|
/**
|
|
* The primary key associated with the table.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $primaryKey = 'codeSujet';
|
|
|
|
/**
|
|
* The users that belong to the sujet.
|
|
*/
|
|
public function users()
|
|
{
|
|
return $this->belongsToMany('App\User', 'sujets_users', 'sujet_id', 'user_id');
|
|
}
|
|
|
|
/**
|
|
* Get the dossier for the sujet.
|
|
*/
|
|
public function dossiers()
|
|
{
|
|
return $this->hasMany('App\Models\Dossier');
|
|
}
|
|
|
|
/**
|
|
* Get the variantes for the sujet.
|
|
*/
|
|
public function variantes()
|
|
{
|
|
return $this->hasMany('App\Models\Variante');
|
|
}
|
|
|
|
/**
|
|
* Get the typeVue for the sujet.
|
|
*/
|
|
public function typeVues()
|
|
{
|
|
return $this->hasMany('App\Models\Typevue');
|
|
}
|
|
|
|
/**
|
|
* Get the medias for the sujet.
|
|
*/
|
|
public function medias()
|
|
{
|
|
return $this->hasMany('App\Models\Media');
|
|
}
|
|
|
|
/**
|
|
* The formats that belong to the sujet.
|
|
*/
|
|
public function formats()
|
|
{
|
|
return $this->belongsToMany('App\Models\Format', 'sujets_formats', 'sujet_id', 'format_id');
|
|
}
|
|
|
|
/**
|
|
* Get the recherches for the sujet.
|
|
*/
|
|
public function recherches()
|
|
{
|
|
return $this->hasMany('App\Models\Recherche');
|
|
}
|
|
}
|