You are here

function og_feeds_get_source in Feeds 6

Same name and namespace in other branches
  1. 7 mappers/og.inc \og_feeds_get_source()

Callback, returns OG of feed node.

1 string reference to 'og_feeds_get_source'
og_feeds_parser_sources_alter in mappers/og.inc
Implementation of hook_feeds_parser_sources_alter().

File

mappers/og.inc, line 24
On behalf implementation of mapping hooks for Organic Groups module.

Code

function og_feeds_get_source(FeedsImportBatch $batch, $key) {
  if ($node = node_load($batch->feed_nid)) {
    if (in_array($node->type, og_get_types('group'))) {
      return array(
        $node->nid => $node->nid,
      );
    }
    else {
      return isset($node->og_groups) ? $node->og_groups : NULL;
    }
  }
}