function entity_delete_multiple in Entity API 7
Permanently delete multiple entities.
Parameters
$entity_type: The type of the entity.
$ids: An array of entity ids of the entities to delete. In case the entity makes use of a name key, both the names or numeric ids may be passed.
Return value
FALSE if the given entity type isn't compatible to the CRUD API.
5 calls to entity_delete_multiple()
- EntityAPITestCase::testCRUDAPIfunctions in ./
entity.test - Tests CRUD API functions: entity_(create|delete|save)
- EntityAPITestCase::testExportableHooks in ./
entity.test - Make sure insert() and update() hooks for exportables are invoked.
- EntityDefaultFeaturesController::revert in ./
entity.features.inc - Generates the result for hook_features_revert().
- entity_delete in ./
entity.module - Permanently delete the given entity.
- entity_modules_disabled in ./
entity.module - Implements hook_modules_disabled().
File
- ./
entity.module, line 335
Code
function entity_delete_multiple($entity_type, $ids) {
$info = entity_get_info($entity_type);
if (isset($info['deletion callback'])) {
foreach ($ids as $id) {
$info['deletion callback']($id);
}
}
elseif (in_array('EntityAPIControllerInterface', class_implements($info['controller class']))) {
entity_get_controller($entity_type)
->delete($ids);
}
else {
return FALSE;
}
}