function entity_delete_multiple

Deletes multiple entities permanently.

Parameters

string $entity_type: The type of the entity.

array $ids: An array of entity IDs of the entities to delete.

20 calls to entity_delete_multiple()
BookTest::testBookDelete in drupal/core/modules/book/lib/Drupal/book/Tests/BookTest.php
Tests the access for deleting top-level book nodes.
CommentLinksTest::setEnvironment in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
Re-configures the environment, module settings, and user permissions.
CommentLinksTest::testCommentLinks in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
Tests comment links.
CommentStorageController::postDelete in drupal/core/modules/comment/lib/Drupal/comment/CommentStorageController.php
Overrides Drupal\Core\Entity\DatabaseStorageController::postDelete().
comment_admin_overview_submit in drupal/core/modules/comment/comment.admin.inc
Form submission handler for comment_admin_overview().

... See full list

File

drupal/core/includes/entity.inc, line 329
Entity API for handling entities like nodes or users.

Code

function entity_delete_multiple($entity_type, array $ids) {
  $controller = Drupal::entityManager()
    ->getStorageController($entity_type);
  $entities = $controller
    ->load($ids);
  $controller
    ->delete($entities);
}