public function cypher() { $data = $this->get_data(); $query = isset($data['query']) ? $data['query'] : ''; if ($query) { $result = $this->model->cypher($query); if ($result) { $this->send_response(200, $result); } else { $this->send_response(400, NULL, Kohana::lang('mining.result_empty')); } } else { $this->send_response(400, NULL, Kohana::lang('mining.invalid_request')); } }
/** * 单例模式 * @return Mining_Model */ public static function &instance() { if (!isset(self::$instance)) { // Create a new instance self::$instance = new Mining_Model(); } return self::$instance; }