send_json($response); } public function load($model, $id) { $model = Abstract_model::get_namespaced_model_path($model); $response = $model::load($id); $this->send_json($response); } public function delete($model, $id) { $model = Abstract_model::get_namespaced_model_path($model); $model::delete($id); } public function fetch($model, $sort_field = null, $sort_direction = null) { $model = Abstract_model::get_namespaced_model_path($model); $options = array(); if ($sort_field != null) { $options ['order_by'] = $sort_field . ' ' . $sort_direction; } $response = $model::fetch_all($options); $this->send_json($response); } public function load_relationship($model, $id) { $model = Abstract_model::get_namespaced_model_path($model); $response = $model::load_relationship($id); $this->send_json($response); } public function jqgrid($model, $filter_model_key = null, $filter_model_value = null) { $model = Abstract_model::get_namespaced_model_path($model); $response = $model::jqgrid($_GET ['page'], $_GET ['rows'], $_GET ['sidx'], $_GET ['sord'], $filter_model_key, $filter_model_value); $this->send_json($response); } }