Drupal Association members fund grants that make connections all over the world.
entity_delete_multiple() calls $storage_controller->delete($entities) directly.
So any code present in the EntityClass::delete() method is never executed. Thus those two lines are not equivalent :
entity_delete_multiple('my_entity_type', array(1)); entity_load('my_entity_type', 1)->delete();
Problem : entity_delete_multiple() is marked deprecated, with the official recommendation being "use $storage_controller->delete($entities)", i.e we promote bypassing the $entity->delete() method, and deleting entities through the controller directly.
Right now, this means that entity-type-specific code for delete() should not be added in the entity type class, but in the storage controller.
- nothing documents that, if that's how we want things to be, Entity::delete() should be final.
- there are definitely cases where the code would be storage-controller agnostic.
Note : The problem doesn't seem to arise for save, since we never added a generic entity_save() function.