BookStack/app/Permissions/Models/JointPermission.php

32 lines
675 B
PHP
Raw Normal View History

2021-06-26 23:23:15 +08:00
<?php
2023-05-18 00:56:55 +08:00
namespace BookStack\Permissions\Models;
2023-05-18 00:56:55 +08:00
use BookStack\App\Model;
use BookStack\Entities\Models\Entity;
2023-05-18 00:56:55 +08:00
use BookStack\Users\Models\Role;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphOne;
class JointPermission extends Model
{
protected $primaryKey = null;
public $timestamps = false;
/**
* Get the role that this points to.
*/
public function role(): BelongsTo
{
return $this->belongsTo(Role::class);
}
/**
* Get the entity this points to.
*/
public function entity(): MorphOne
{
return $this->morphOne(Entity::class, 'entity');
}
}