mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Rolled out redesign across application
This commit is contained in:
@ -44,4 +44,21 @@ class Entity extends Model
|
||||
return $this->morphMany('Oxbow\Activity', 'entity')->orderBy('created_at', 'desc');
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows checking of the exact class, Used to check entity type.
|
||||
* Cleaner method for is_a.
|
||||
* @param $type
|
||||
* @return bool
|
||||
*/
|
||||
public function isA($type)
|
||||
{
|
||||
return $this->getName() === strtolower($type);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
$fullClassName = get_class($this);
|
||||
return strtolower(array_slice(explode('\\', $fullClassName), -1, 1)[0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user