public function export_csv()
 {
     $c_id = Request::get_c_id();
     $session_id = Request::get_session_id();
     $course = (object) array();
     $course->c_id = $c_id;
     $course->session_id = $session_id;
     $descriptions = CourseDescription::repository()->find_by_course($course);
     $writer = new CsvWriter();
     $writer->add($descriptions);
     $path = $writer->get_path();
     \DocumentManager::file_send_for_download($path, true, get_lang('CourseDescriptions') . '.csv');
 }
 /**
  *
  */
 public function delete_by_course()
 {
     if (!$this->is_allowed_to_edit()) {
         $this->forbidden();
         return;
     }
     $course = (object) array();
     $course->c_id = Request::get_c_id();
     $course->session_id = Request::get_session_id();
     $success = CourseDescription::repository()->remove_by_course($course);
     $this->response($success);
 }