]> BookStack Code Mirror - bookstack/blob - app/Auth/Permissions/JointPermission.php
Apply fixes from StyleCI
[bookstack] / app / Auth / Permissions / JointPermission.php
1 <?php
2
3 namespace BookStack\Auth\Permissions;
4
5 use BookStack\Auth\Role;
6 use BookStack\Entities\Models\Entity;
7 use BookStack\Model;
8 use Illuminate\Database\Eloquent\Relations\BelongsTo;
9 use Illuminate\Database\Eloquent\Relations\MorphOne;
10
11 class JointPermission extends Model
12 {
13     protected $primaryKey = null;
14     public $timestamps = false;
15
16     /**
17      * Get the role that this points to.
18      */
19     public function role(): BelongsTo
20     {
21         return $this->belongsTo(Role::class);
22     }
23
24     /**
25      * Get the entity this points to.
26      */
27     public function entity(): MorphOne
28     {
29         return $this->morphOne(Entity::class, 'entity');
30     }
31 }