<?php namespace BookStack;
-
use Illuminate\Database\Eloquent\Relations\MorphMany;
class Entity extends Ownable
{
$matches = [get_class($this), $this->id] === [get_class($entity), $entity->id];
- if ($matches) return true;
+ if ($matches) {
+ return true;
+ }
if (($entity->isA('chapter') || $entity->isA('page')) && $this->isA('book')) {
return $entity->book_id === $this->id;
*/
public function getShortName($length = 25)
{
- if (strlen($this->name) <= $length) return $this->name;
+ if (strlen($this->name) <= $length) {
+ return $this->name;
+ }
return substr($this->name, 0, $length - 3) . '...';
}
* Return a generalised, common raw query that can be 'unioned' across entities.
* @return string
*/
- public function entityRawQuery(){return '';}
+ public function entityRawQuery()
+ {
+ return '';
+ }
/**
* Get the url of this entity
* @param $path
* @return string
*/
- public function getUrl($path){return '/';}
-
+ public function getUrl($path)
+ {
+ return '/';
+ }
}