1
0
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:
Dan Brown
2015-08-31 11:43:28 +01:00
parent 505a22bc7b
commit 598fd7811b
22 changed files with 528 additions and 352 deletions

View File

@ -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]);
}
}