You are here

function instagram_feeds_plugins_feeds_presave in Instagram Feeds 7

Invoked before a feed item is saved.

Parameters

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

object $entity: The entity object.

File

modules/instagram_feeds_plugins/instagram_feeds_plugins.module, line 178
Code for the Instagram Feeds Plugin module.

Code

function instagram_feeds_plugins_feeds_presave(FeedsSource $source, $entity) {
  if ('InstagramFeedsPluginsPager' == $source->importer->config['fetcher']['plugin_key']) {
    if (!isset($source
      ->state(FEEDS_FETCH)->item_count[$source->config['InstagramFeedsPluginsPager']['source']])) {
      $source
        ->state(FEEDS_FETCH)->item_count = array(
        $source->config['InstagramFeedsPluginsPager']['source'] => 0,
      );
    }
    $source
      ->state(FEEDS_FETCH)->item_count[$source->config['InstagramFeedsPluginsPager']['source']]++;
  }
}