You are here

public function DataProviderEntity::remove in RESTful 7.2

Delete operation.

Parameters

mixed $identifier: The ID of thing to be removed.

Overrides CrudInterface::remove

File

src/Plugin/resource/DataProvider/DataProviderEntity.php, line 320
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderEntity.

Class

DataProviderEntity
Class DataProviderEntity.

Namespace

Drupal\restful\Plugin\resource\DataProvider

Code

public function remove($identifier) {
  $this
    ->isValidEntity('delete', $identifier);

  /* @var \EntityDrupalWrapper $wrapper */
  $wrapper = entity_metadata_wrapper($this->entityType, $identifier);
  $wrapper
    ->delete();

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