]> BookStack Code Mirror - bookstack/blob - app/Permissions/Models/JointPermission.php
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / app / Permissions / Models / JointPermission.php
1 <?php
2
3 namespace BookStack\Permissions\Models;
4
5 use BookStack\App\Model;
6 use BookStack\Entities\Models\Entity;
7 use BookStack\Users\Models\Role;
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 }