ldc-dam/app/Models/Sujet.php
Jérémy Munsch 9767e62c72
Update NPM deps and webpack.mix.js
composer require ldc/web-status-checker-laravel remove Old static status checker

Fix ImportMedia

WIP commands OK

many fixes

Fix and try to optimize folder component

Fix front icons + actions based on icons

Favico

front fix alert

Fix Media upload on depot

fix folder component buttons

Full front fix with perf due tu vuejs

Download medias

Navigate within medias superfix

Move media + loader

isLocked boolean and remove media fix

Folder scroll fix

arcadia link color red

Fix panier show external

Tons of fixes back as front

REwrited all
2022-07-22 17:00:48 +02:00

117 lines
2.4 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';
/**
* Indicates if the IDs are auto-incrementing.
*
* @var boolean
*/
public $incrementing = false;
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'sujet_dam' => 'bool'
];
// * RELATIONSHIPS
/**
* BelongsToMany users relation
*
* The users that belong to the sujet.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function users()
{
return $this->belongsToMany(User::class);
}
/**
* HasMany dossiers relation
*
* Get the dossier for the sujet.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function dossiers()
{
return $this->hasMany(Dossier::class);
}
/**
* HasMany variantes relation
*
* Get the variantes for the sujet.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function variantes()
{
return $this->hasMany(Variante::class, 'sujet_id', 'codeSujet');
}
/**
* HasMany typeVues relation
*
* Get the typeVue for the sujet.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function typeVues()
{
return $this->hasMany(TypeVue::class, 'sujet_id', 'codeSujet');
}
/**
* HasMany media relation
*
* Get the media for the sujet.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function mediaList()
{
return $this->hasMany(Media::class);
}
/**
* BelongsToMany formats relation
*
* The formats that belong to the sujet.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function formats()
{
return $this->belongsToMany(Format::class, 'sujet_format', 'sujet_id');
}
/**
* HasMany recherches relation
*
* Get the recherches for the sujet.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function recherches()
{
return $this->hasMany(Recherche::class);
}
}