mangaRepository->findVisibleChapterById($command->chapterId); if (!$chapter) { throw new ChapterNotFoundException($command->chapterId); } if (!$chapter->isAvailable()) { throw new CbzFileNotFoundException($command->chapterId); } $manga = $this->mangaRepository->findById($chapter->getMangaId()->getValue()); $manga->removeChapterPages($chapter); $this->mangaRepository->save($manga); } }