Exemplo n.º 1
0
 /**
  * Scaffold delete
  */
 protected function ScaffoldRemove()
 {
     $this->rest->method('POST');
     $parms = $this->getRequest()->getPost();
     $this->rest->paramsMustMap = array('primary');
     $this->rest->paramsMustValid($parms);
     $result = $this->db->delete($this->table_name, array($this->primary => $parms['primary']));
     if ($result) {
         $this->rest->success();
     }
     $this->rest->error();
 }
Exemplo n.º 2
0
 /**
  * 主要check流程
  * @param string $key
  */
 public function check($key = NULL)
 {
     self::getkey($key);
     $ready = $this->cache->get($this->key);
     if ($ready == FALSE) {
         $this->cache->set($this->key, array(time()));
         return;
     }
     $ready_ = $ready;
     if (self::checkCountAndTime($ready_)) {
         $this->rest->error(rest_Code::STATUS_ERROR_API_QUENCY_M);
     }
     unset($ready_);
     array_push($ready, time());
     $this->cache->set($this->key, $ready);
 }