You are here

protected function EntityShareServerRest::handleDelete in Entity Share 7

Handle the DELETE method action.

Delete an entity by UUID.

Overrides EntityShareServerRestAbstract::handleDelete

File

modules/entity_share_server/includes/entity_share_server.rest.inc, line 94
Class for handling REST request.

Class

EntityShareServerRest
Class EntityShareServerRest.

Code

protected function handleDelete() {
  try {
    $result = entity_uuid_delete($this
      ->getParam('type'), $this
      ->getParam('id'));
    $this
      ->setResult($result === FALSE ? FALSE : TRUE);
  } catch (Exception $e) {
    $this
      ->setError('Error will trying to delete entity', '500 Internal Server Error');
  }
}