X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/3043/head:/app/Entities/Repos/ChapterRepo.php diff --git a/app/Entities/Repos/ChapterRepo.php b/app/Entities/Repos/ChapterRepo.php index d56874e0d..68330dd57 100644 --- a/app/Entities/Repos/ChapterRepo.php +++ b/app/Entities/Repos/ChapterRepo.php @@ -1,4 +1,6 @@ -priority = (new BookContents($parentBook))->getLastPriority() + 1; $this->baseRepo->create($chapter, $input); Activity::addForEntity($chapter, ActivityType::CHAPTER_CREATE); + return $chapter; } @@ -59,11 +61,13 @@ class ChapterRepo { $this->baseRepo->update($chapter, $input); Activity::addForEntity($chapter, ActivityType::CHAPTER_UPDATE); + return $chapter; } /** * Remove a chapter from the system. + * * @throws Exception */ public function destroy(Chapter $chapter) @@ -77,7 +81,8 @@ class ChapterRepo /** * Move the given chapter into a new parent book. * The $parentIdentifier must be a string of the following format: - * 'book:' (book:5) + * 'book:' (book:5). + * * @throws MoveOperationException */ public function move(Chapter $chapter, string $parentIdentifier): Book