public function saveAction() { $response = $this->controller->execute('save'); $id = $this->response->getVariable('savedRecordID'); $course_id = $this->request->getSessionData('course_id'); $reading_list = new ReadingList($this->request->requireSessionData('course_id', 'Session has expired')); $reading_list->assignRecords(array($id)); return $response; }