function commerce_pricelist_feeds_entity_delete in Commerce Pricelist 7
Implements hook_entity_delete().
File
- commerce_pricelist_feeds/
commerce_pricelist_feeds.module, line 170 - Implements the basic functionality required to create and display an entity.
Code
function commerce_pricelist_feeds_entity_delete($entity, $type) {
// Source attached to entity.
// Make sure we don't leave any orphans behind: Do not use
// feeds_get_importer_id() to determine importer id as the importer may have
// been deleted.
if ($type == 'commerce_pricelist_list') {
$fake_nid = _commerce_pricelist_feeds_fake_nid($entity);
if ($importer_id = db_query("SELECT id FROM {feeds_source} WHERE feed_nid = :nid", array(
':nid' => $fake_nid,
))
->fetchField()) {
feeds_source($importer_id, $fake_nid)
->delete();
}
}
}