You are here

function og_feeds_get_source in Feeds 7

Same name and namespace in other branches
  1. 6 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
Implements 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 = $batch
    ->feedNode()) {
    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;
    }
  }
}