checkChapterVod($id); } public function checkChapterLive($id) { $validator = new ChapterValidator(); return $validator->checkChapterLive($id); } public function checkChapterRead($id) { $validator = new ChapterValidator(); return $validator->checkChapterRead($id); } public function checkChapter($id) { $validator = new ChapterValidator(); return $validator->checkChapter($id); } public function checkChapterCache($id) { $validator = new ChapterValidator(); return $validator->checkChapterCache($id); } public function setChapterUser(ChapterModel $chapter, UserModel $user) { if ($user->id == 0) return; $chapterUser = null; /** * @var CourseUserModel $courseUser */ $courseUser = $this->courseUser; if ($courseUser) { $chapterUserRepo = new ChapterUserRepo(); $chapterUser = $chapterUserRepo->findPlanChapterUser($chapter->id, $user->id, $courseUser->plan_id); } $this->chapterUser = $chapterUser; if ($chapterUser) { $this->joinedChapter = true; } if ($this->ownedCourse || $chapter->free) { $this->ownedChapter = true; } } }