X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/ac80723058ab4c86e6bf024e0c75b60ab6c59624..refs/pull/846/head:/app/PageRevision.php diff --git a/app/PageRevision.php b/app/PageRevision.php index ff469f0ed..ffcc4f9d2 100644 --- a/app/PageRevision.php +++ b/app/PageRevision.php @@ -1,6 +1,5 @@ page->getUrl() . '/revisions/' . $this->id; - if ($path) return $url . '/' . trim($path, '/'); + if ($path) { + return $url . '/' . trim($path, '/'); + } return $url; } @@ -47,4 +48,15 @@ class PageRevision extends Model return null; } + /** + * Allows checking of the exact class, Used to check entity type. + * Included here to align with entities in similar use cases. + * (Yup, Bit of an awkward hack) + * @param $type + * @return bool + */ + public static function isA($type) + { + return $type === 'revision'; + } }