]> BookStack Code Mirror - bookstack/blobdiff - app/PageRevision.php
Updated 'Spanish Argentina' translation.
[bookstack] / app / PageRevision.php
index ff469f0ed3a78b3d3750c3ff6d07b6b2d787c226..ffcc4f9d25b26ec81eb6fc89db62b4393666e0a6 100644 (file)
@@ -1,6 +1,5 @@
 <?php namespace BookStack;
 
-
 class PageRevision extends Model
 {
     protected $fillable = ['name', 'html', 'text', 'markdown', 'summary'];
@@ -31,7 +30,9 @@ class PageRevision extends Model
     public function getUrl($path = null)
     {
         $url = $this->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';
+    }
 }