Ejemplo n.º 1
0
 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'));
     }
 }
Ejemplo n.º 2
0
 /**
  * 单例模式
  * @return Mining_Model
  */
 public static function &instance()
 {
     if (!isset(self::$instance)) {
         // Create a new instance
         self::$instance = new Mining_Model();
     }
     return self::$instance;
 }