function hook_feeds_presave in Feeds 8.2
Same name and namespace in other branches
- 7.2 feeds.api.php \hook_feeds_presave()
Invoked before a feed item is saved.
Parameters
FeedsSource $source: FeedsSource object that describes the source that is being imported.
$entity: The entity object.
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 invocation of hook_feeds_presave()
- FeedsProcessor::process in lib/
Drupal/ feeds/ Plugin/ FeedsProcessor.php - Process the result of the parsing stage.
File
- ./
feeds.api.php, line 148 - Documentation of Feeds hooks.
Code
function hook_feeds_presave(FeedsSource $source, $entity, $item) {
if ($entity->feeds_item->entity_type == 'node') {
// Skip saving this entity.
$entity->feeds_item->skip = TRUE;
}
}