gwChapter = new GatewayChapter(); } function getChapters() { $chaptersDataArray = $this->gwChapter->getChapters(); $chapters = array(); foreach ($chaptersDataArray as $chapterDataArray) { $chapter = new Chapter($chapterDataArray['id'],$chapterDataArray["name"]); $chapters[] = $chapter; } return $chapters; } function deleteChapter($id) { $this->gwChapter->deleteChapter($id); } function addChapter($chapter) { $this->gwChapter->addChapter($chapter); } function getChapterByID($id) { $chapterDataArray = $this->gwChapter->getChapterByID($id); $chapter = new Chapter($chapterDataArray['id'],$chapterDataArray['name']); return $chapter; } function updateChapter($id, $chapter) { $this->gwChapter->updateChapter($id, $chapter); } public function verifyChapter($chapter) { $id = $this->gwChapter->verifyChapter($chapter); return $id; } }