Example #1
0
 /**
  * Recebe um parametro no formato:
  * contato?id=valor
  */
 private function contato()
 {
     if ($this->get_request_method() !== 'GET') {
         $this->response('', API::STATUS_NOT_ACCEPTABLE);
     }
     $idContato = (int) $this->_request['id'];
     if ($idContato > 0) {
         $objeto = DBJson::getContatoByID($idContato);
         if (!empty($objeto)) {
             $this->response($this->json($objeto), API::STATUS_OK);
         }
     }
     $this->response('', API::STATUS_NO_CONTENT);
 }