Change record status: 
Project: 
Introduced in branch: 
8.8.x
Introduced in version: 
8.8.0
Description: 

entity_delete_multiple is deprecated and will officially trigger an error in 8.8.0
Use the entity storage's delete() method to delete multiple entities:

Before:
entity_delete_multiple($entity_type, $ids)

Now:

$storage_handler = \Drupal::entityTypeManager()->getStorage($entity_type);
$entities = $storage_handler->loadMultiple($ids);
$storage_handler->delete($entities);

Comments

jmsosso’s picture

It's actually needed to load all entities from database just to delete they?

Perhaps it's due the access checks, but what about if what I want to accomplish is to delete entities in a cron job? Is there any other way without to use database commands?