mangaRepository->findVisibleChapterById($command->chapterId); if (!$chapter) { throw new ChapterNotFoundException($command->chapterId); } $updatedChapter = new Chapter( id: new ChapterId($chapter->getId()), mangaId: $chapter->getMangaId(), number: $chapter->getNumber(), title: $chapter->getTitle(), volume: $chapter->getVolume(), isVisible: false, pagesDirectory: $chapter->getPagesDirectory(), pageCount: $chapter->getPageCount(), createdAt: $chapter->getCreatedAt() ); $this->mangaRepository->updateChapter($updatedChapter); } }