BookStack/app/EntityPermission.php
Dan Brown 59367b3417 Improved permission regen performance by factor of 4
Worked around slower eloquent access to speed up permission generation.
2016-04-30 17:16:06 +01:00

25 lines
526 B
PHP

<?php namespace BookStack;
class EntityPermission extends Model
{
public $timestamps = false;
/**
* Get the role that this points to.
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function role()
{
return $this->belongsTo(Role::class);
}
/**
* Get the entity this points to.
* @return \Illuminate\Database\Eloquent\Relations\MorphOne
*/
public function entity()
{
return $this->morphOne(Entity::class, 'entity');
}
}