You are here

public function EntityResource::deleteIndividual in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/Controller/EntityResource.php \Drupal\jsonapi\Controller\EntityResource::deleteIndividual()
  2. 10 core/modules/jsonapi/src/Controller/EntityResource.php \Drupal\jsonapi\Controller\EntityResource::deleteIndividual()

Deletes an individual entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The loaded entity.

Return value

\Drupal\jsonapi\ResourceResponse The response.

File

core/modules/jsonapi/src/Controller/EntityResource.php, line 371

Class

EntityResource
Process all entity requests.

Namespace

Drupal\jsonapi\Controller

Code

public function deleteIndividual(EntityInterface $entity) {
  $entity
    ->delete();
  return new ResourceResponse(NULL, 204);
}