<?php namespace BookStack;
-
class PageRevision extends Model
{
protected $fillable = ['name', 'html', 'text', 'markdown', 'summary'];
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;
}
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';
+ }
}