I came upon this when writing an Entity API destination plugin for Migrate.
Would be great if entity_delete_multiple() would support deletion callbacks (sure, needs a foreach, but it still allows me to use entity_delete_multiple() everywhere and get the benefits of mass deletion if the module is using EntityAPIControllerInterface).

CommentFileSizeAuthor
#1 1124558.patch1.51 KBbojanz

Comments

bojanz’s picture

Status: Active » Needs review
StatusFileSize
new1.51 KB

Here's a completely untested patch.

Funny thing is, Commerce has it's own controllers, and it's own delete and delete_multiple functions, but since there's only "deletion callback" and no "deletion multiple callback', it needs to go through the slower route. One more reason for moving to EntityAPIController I guess.

fago’s picture

Status: Needs review » Fixed

Thanks.

We also might want to allow modules to define their multiple callback in hook_entity_info() and use that if its there. Anyway, the patch improves things and works (tests are green) so I've committed it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.