You are here

public function FeedsTermProcessor::vocabulary in Feeds 7

Same name and namespace in other branches
  1. 6 plugins/FeedsTermProcessor.inc \FeedsTermProcessor::vocabulary()
  2. 7.2 plugins/FeedsTermProcessor.inc \FeedsTermProcessor::vocabulary()

Return vocabulary to map to.

5 calls to FeedsTermProcessor::vocabulary()
FeedsTermProcessor::clear in plugins/FeedsTermProcessor.inc
Implements FeedsProcessor::clear().
FeedsTermProcessor::existingItemId in plugins/FeedsTermProcessor.inc
Get id of an existing feed item term if available.
FeedsTermProcessor::getMappingTargets in plugins/FeedsTermProcessor.inc
Return available mapping targets.
FeedsTermProcessor::map in plugins/FeedsTermProcessor.inc
Execute mapping on an item.
FeedsTermProcessor::process in plugins/FeedsTermProcessor.inc
Implements FeedsProcessor::process().

File

plugins/FeedsTermProcessor.inc, line 226
FeedsTermProcessor class.

Class

FeedsTermProcessor
Feeds processor plugin. Create taxonomy terms from feed items.

Code

public function vocabulary() {

  // Legacy handling for old feeds importers.
  if (is_numeric($this->config['vocabulary'])) {
    $vocabularies = taxonomy_get_vocabularies();
    return isset($vocabularies[$this->config['vocabulary']]) ? $vocabularies[$this->config['vocabulary']] : NULL;
  }
  else {
    if ($vocabulary = taxonomy_vocabulary_machine_name_load($this->config['vocabulary'])) {
      return $vocabulary;
    }
    else {
      $vocabularies = taxonomy_get_vocabularies();
      foreach ($vocabularies as $vocabulary) {
        if ($vocabulary->module == $this->config['vocabulary']) {
          return $vocabulary;
        }
      }
    }
  }
}