checkChapter($id); } public function checkChapterCache($id) { $validator = new ChapterValidator(); return $validator->checkChapterCache($id); } public function setChapterUser(ChapterModel $chapter, UserModel $user) { $chapterUserRepo = new ChapterUserRepo(); $chapterUser = $chapterUserRepo->findChapterUser($chapter->id, $user->id); if ($chapterUser) { $this->joinedChapter = true; } if ($this->ownedCourse || $chapter->free) { $this->ownedChapter = true; } } }