]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Repos/BookRepo.php
Show bookshelves that a book belongs to on a book view
[bookstack] / app / Entities / Repos / BookRepo.php
index c82780fea39d4399b24034fd9f7deaf78e401863..91bc9a1b41eebafb74cfe8aeaae1ff0344528d86 100644 (file)
@@ -3,9 +3,7 @@
 
 namespace BookStack\Entities\Repos;
 
-
 use BookStack\Entities\Book;
-use BookStack\Entities\Bookshelf;
 use BookStack\Exceptions\NotFoundException;
 use BookStack\Exceptions\NotifyException;
 
@@ -25,21 +23,6 @@ class BookRepo extends EntityRepo
         return $book;
     }
 
-    /**
-     * Append a Book to a BookShelf.
-     * @param Bookshelf $shelf
-     * @param Book $book
-     */
-    public function appendBookToShelf(Bookshelf $shelf, Book $book)
-    {
-        if ($shelf->contains($book)) {
-            return;
-        }
-
-        $maxOrder = $shelf->books()->max('order');
-        $shelf->books()->attach($book->id, ['order' => $maxOrder + 1]);
-    }
-
     /**
      * Destroy the provided book and all its child entities.
      * @param Book $book