You are here

function taxonomy_feeds_get_source in Feeds 8.2

Same name and namespace in other branches
  1. 6 mappers/taxonomy.inc \taxonomy_feeds_get_source()
  2. 7.2 mappers/taxonomy.inc \taxonomy_feeds_get_source()
  3. 7 mappers/taxonomy.inc \taxonomy_feeds_get_source()

Callback, returns taxonomy from feed node.

1 string reference to 'taxonomy_feeds_get_source'
taxonomy_feeds_parser_sources_alter in mappers/taxonomy.inc
Implements hook_feeds_parser_sources_alter().

File

mappers/taxonomy.inc, line 51
On behalf implementation of Feeds mapping API for taxonomy.module.

Code

function taxonomy_feeds_get_source(FeedsSource $source, FeedsParserResult $result, $key) {
  if ($node = node_load($source->feed_nid)
    ->getNGEntity()) {
    list(, , $field) = explode(':', $key, 3);
    $result = array();
    foreach ($node->{$field} as $term) {
      $result[] = $term;
    }
    return $result;
  }
}