entity_delete_multiple($entity_type, array $ids)
Deletes multiple entities permanently.
$storage_handler = \Drupal::entityTypeManager()->getStorage($entity_type); $entities = $storage_handler->loadMultiple($ids); $storage_handler->delete($entities);
string $entity_type: The type of the entity.
array $ids: An array of entity IDs of the entities to delete.
as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use the entity storage's delete() method to delete multiple entities:
\Drupal\Core\Entity\EntityTypeManagerInterface::getStorage()
\Drupal\Core\Entity\EntityStorageInterface::loadMultiple()
\Drupal\Core\Entity\EntityStorageInterface::delete()
function entity_delete_multiple($entity_type, array $ids) { $controller = \Drupal::entityManager()->getStorage($entity_type); $entities = $controller->loadMultiple($ids); $controller->delete($entities); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!entity.inc/function/entity_delete_multiple/8.1.x