2018-08-10 17:14:09 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Models;
|
|
|
|
|
2018-12-29 12:03:22 +01:00
|
|
|
use Common\Model;
|
2018-08-10 17:14:09 +02:00
|
|
|
|
|
|
|
class View extends Model
|
|
|
|
{
|
|
|
|
protected $table = 'zz_views';
|
|
|
|
|
|
|
|
public function getQueryAttribute($value)
|
|
|
|
{
|
2019-02-01 17:44:31 +01:00
|
|
|
return Util\Query::replacePlaceholder($value);
|
2018-08-10 17:14:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Relazioni Eloquent */
|
|
|
|
|
|
|
|
public function groups()
|
|
|
|
{
|
|
|
|
return $this->belongsToMany(Group::class, 'zz_group_view', 'id_vista', 'id_gruppo');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function module()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Module::class, 'id_module');
|
|
|
|
}
|
|
|
|
}
|