]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Chapter.php
Show bookshelves that a book belongs to on a book view
[bookstack] / app / Entities / Chapter.php
index b204f1903034663e755a6ca85bb38cf7f26683f3..d121432fa1a65035b03975b561dcfe70537b741e 100644 (file)
@@ -1,6 +1,8 @@
 <?php namespace BookStack\Entities;
 
-class Chapter extends Entity
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+
+class Chapter extends BookChild
 {
     public $searchFactor = 1.3;
 
@@ -15,15 +17,6 @@ class Chapter extends Entity
         return 'BookStack\\Chapter';
     }
 
-    /**
-     * Get the book this chapter is within.
-     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
-     */
-    public function book()
-    {
-        return $this->belongsTo(Book::class);
-    }
-
     /**
      * Get the pages that this chapter contains.
      * @param string $dir