Configuration du jeu possible + bugfixs
This commit is contained in:
@ -27,4 +27,49 @@ class Oeuvre extends Model {
|
||||
public function datation() {
|
||||
return $this->hasMany('App\Datation');
|
||||
}
|
||||
|
||||
public function scopeAuthorFilter($query, $array)
|
||||
{
|
||||
if ($array == []) return $query;
|
||||
$query->whereHas('auteur', function($q) use ($array)
|
||||
{
|
||||
$q->whereIn('id', $array);
|
||||
});
|
||||
}
|
||||
|
||||
public function scopeDesignationFilter($query, $array)
|
||||
{
|
||||
if ($array == []) return $query;
|
||||
$query->whereHas('designation', function($q) use ($array)
|
||||
{
|
||||
$q->whereIn('id', $array);
|
||||
});
|
||||
}
|
||||
|
||||
public function scopeDomaineFilter($query, $array)
|
||||
{
|
||||
if ($array == []) return $query;
|
||||
$query->whereHas('domaine', function($q) use ($array)
|
||||
{
|
||||
$q->whereIn('id', $array);
|
||||
});
|
||||
}
|
||||
|
||||
public function scopeMatiereFilter($query, $array)
|
||||
{
|
||||
if ($array == []) return $query;
|
||||
$query->whereHas('matiere', function($q) use ($array)
|
||||
{
|
||||
$q->whereIn('id', $array);
|
||||
});
|
||||
}
|
||||
|
||||
public function scopeTechniqueFilter($query, $array)
|
||||
{
|
||||
if ($array == []) return $query;
|
||||
$query->whereHas('technique', function($q) use ($array)
|
||||
{
|
||||
$q->whereIn('id', $array);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user