You are here

function hook_feeds_after_save in Feeds 7.2

Same name and namespace in other branches
  1. 8.2 feeds.api.php \hook_feeds_after_save()

Invoked after a feed item has been saved.

Parameters

FeedsSource $source: FeedsSource object that describes the source that is being imported.

object $entity: The entity object that has just been saved.

array $item: The parser result for this entity.

int|null $entity_id: The id of the current item which is going to be updated. If this is a new item, then NULL is passed.

Related topics

1 function implements hook_feeds_after_save()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

feeds_tests_feeds_after_save in tests/feeds_tests.module
Implements hook_feeds_after_save().
1 invocation of hook_feeds_after_save()
FeedsProcessor::process in plugins/FeedsProcessor.inc
Process the result of the parsing stage.

File

./feeds.api.php, line 205
Documentation of Feeds hooks.

Code

function hook_feeds_after_save(FeedsSource $source, $entity, $item, $entity_id) {

  // Although the $entity object is passed by reference, any changes made in
  // this function will be ignored by the FeedsProcessor.
  $config = $source->importer
    ->getConfig();
  if ($config['processor']['config']['purge_unseen_items'] && isset($entity->feeds_item)) {
    $feeds_item = $entity->feeds_item;
    $feeds_item->batch_id = feeds_delete_get_current_batch($feeds_item->feed_nid);
    drupal_write_record('feeds_delete_item', $feeds_item);
  }
}