]> BookStack Code Mirror - bookstack/blobdiff - app/Ownable.php
Finished initial implementation of custom role system
[bookstack] / app / Ownable.php
index d6505b7460440f95f1bf9e8eecd09ae6775129bd..28d55c2bb98156cb08a4b6e2e44842270f4bbe99 100644 (file)
@@ -1,7 +1,8 @@
 <?php namespace BookStack;
 
+use Illuminate\Database\Eloquent\Model;
 
-trait Ownable
+abstract class Ownable extends Model
 {
     /**
      * Relation for the user that created this entity.
@@ -20,4 +21,14 @@ trait Ownable
     {
         return $this->belongsTo('BookStack\User', 'updated_by');
     }
+
+    /**
+     * Gets the class name.
+     * @return string
+     */
+    public static function getClassName()
+    {
+        return strtolower(array_slice(explode('\\', static::class), -1, 1)[0]);
+    }
+
 }
\ No newline at end of file