lifetime; } public function getKey($id = null) { return "course_chapter_list:{$id}"; } public function getContent($id = null) { $courseRepo = new CourseRepo(); $chapters = $courseRepo->findChapters($id); if ($chapters->count() == 0) { return []; } return $this->handleContent($chapters); } /** * @param Resultset $chapters * @return array */ protected function handleContent($chapters) { $items = $chapters->toArray(); $builder = new ChapterTreeListBuilder(); return $builder->handleTreeList($items); } }