X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/bc1302a8d8c9c7facb16b28e1cf1da4409e7ede0..refs/pull/806/head:/app/Entity.php diff --git a/app/Entity.php b/app/Entity.php index df8e4d38b..5d4449f2b 100644 --- a/app/Entity.php +++ b/app/Entity.php @@ -1,13 +1,20 @@ 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; @@ -159,7 +168,9 @@ class Entity extends Ownable */ 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) . '...'; } @@ -176,13 +187,18 @@ class Entity extends Ownable * 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 $path; + } }