load->model('system/UDF_model', 'UDFModel'); } /** * @return void */ public function getUDF() { $decode = $this->get('decode'); $schema = $this->get('schema'); $table = $this->get('table'); $result = error(); if (isset($schema) || isset($table)) { $result = $this->UDFModel->loadWhere( array( 'schema' => $schema, 'table' => $table ) ); } else { $result = $this->UDFModel->load(); } if ($decode) { $this->_jsonDecodeResult($result); } $this->response($result, REST_Controller::HTTP_OK); } /** * Decode to json the column jsons for every result set */ private function _jsonDecodeResult(&$result) { if (hasData($result)) { for($i = 0; $i < count($result->retval); $i++) { $obj = $result->retval[$i]; $obj->jsons = json_decode($obj->jsons); } } } }