ldc-dam/app/Sujet.php
Yann Gonidec 7b857744f7 front : fin edition média
front : téléchargement de média
command : suppression des média archivés - regénération des miniatures - import des fichiers Arcadia
2019-07-11 11:45:47 +02:00

64 lines
1.1 KiB
PHP

<?php
namespace App;
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\Dossier');
}
/**
* Get the variantes for the sujet.
*/
public function variantes()
{
return $this->hasMany('App\Variante');
}
/**
* Get the typeVue for the sujet.
*/
public function typeVues()
{
return $this->hasMany('App\Typevue');
}
/**
* Get the medias for the sujet.
*/
public function medias()
{
return $this->hasMany('App\Media');
}
/**
* The formats that belong to the sujet.
*/
public function formats()
{
return $this->belongsToMany('App\Format', 'sujets_formats', 'sujet_id', 'format_id');
}
}