You are here

function redhen_note_entity_delete in RedHen CRM 7

Implements hook_entity_delete().

File

modules/redhen_note/redhen_note.module, line 309
Redhen Notes main module

Code

function redhen_note_entity_delete($entity, $type) {

  // Delete redhen_note who's parent entity has been deleted
  list($id) = entity_extract_ids($type, $entity);
  $notes = redhen_note_load_multiple(FALSE, array(
    'entity_type' => $type,
    'entity_id' => $id,
  ));
  $note_ids = array_keys($notes);
  redhen_note_delete_multiple($note_ids);
}