示例#1
0
 public function deleteAction()
 {
     if (!$this->request->isDelete()) {
         return $this->showErrorMessageAsJson(405, 'ERR_REQUEST_METHOD_NOT_ALLOW');
     }
     $id = $this->dispatcher->getParam('id');
     $entry = new Models\Entry();
     try {
         $entry->removeEntry($id);
     } catch (\Exception $e) {
         return $this->showExceptionAsJson($e, $entry->getMessages());
     }
     return $this->response->setJsonContent($entry);
 }