You are here

public function FeedsTermProcessor::vocabulary in Feeds 6

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

Return vocabulary to map to.

Feeds supports looking up vocabularies by their module name as part of an effort to use the vocabulary.module field as machine name to make vocabularies exportable.

5 calls to FeedsTermProcessor::vocabulary()
FeedsTermProcessor::clear in plugins/FeedsTermProcessor.inc
Implementation of 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
Implementation of FeedsProcessor::process().

File

plugins/FeedsTermProcessor.inc, line 315
FeedsTermProcessor class.

Class

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

Code

public function vocabulary() {

  // The default value is 0.
  if (!$this->config['vocabulary']) {
    return;
  }
  $vocabularies = taxonomy_get_vocabularies();
  if ($this->config['vocabulary'] && is_numeric($this->config['vocabulary'])) {
    return $vocabularies[$this->config['vocabulary']];
  }
  else {
    foreach ($vocabularies as $vocabulary) {
      if ($vocabulary->module == $this->config['vocabulary']) {
        return $vocabulary;
      }
    }
  }
}