You are here

public function RestfulEntityBase::deleteEntity in RESTful 7

Delete an entity using DELETE.

No result is returned, just the HTTP header is set to 204.

Parameters

$id: The ID to load the entity.

Overrides RestfulDataProviderEFQ::deleteEntity

File

plugins/restful/RestfulEntityBase.php, line 596
Contains RestfulEntityBase.

Class

RestfulEntityBase
An abstract implementation of RestfulEntityInterface.

Code

public function deleteEntity($entity_id) {
  $this
    ->isValidEntity('delete', $entity_id);
  $wrapper = entity_metadata_wrapper($this->entityType, $entity_id);
  $wrapper
    ->delete();

  // Set the HTTP headers.
  $this
    ->setHttpHeaders('Status', 204);
}