public function find_by_id() { $c_id = Request::get_c_id(); $id = Request::get_id(); $item = Notebook::repository()->find_one_by_id($c_id, $id); $data = (object) array(); if ($item) { $data->title = $item->title; $data->description = $item->description; } $this->response($success, '', $data); }
public function export_csv() { $course = Request::get_course_key(); $items = Notebook::repository()->find_by_course($course); $writer = CsvWriter::create(); $writer->add($items); $path = $writer->get_path(); \DocumentManager::file_send_for_download($path, true, get_lang('Notebook') . '.csv'); }