You are here

protected function FeedsTermProcessor::entityLoad in Feeds 7.2

Load an existing entity.

Overrides FeedsProcessor::entityLoad

File

plugins/FeedsTermProcessor.inc, line 45
FeedsTermProcessor class.

Class

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

Code

protected function entityLoad(FeedsSource $source, $entity_id) {
  $entity = parent::entityLoad($source, $entity_id);

  // Avoid missing bundle errors when term has been loaded directly from db.
  if (empty($entity->vocabulary_machine_name) && !empty($entity->vid)) {
    $vocabulary = taxonomy_vocabulary_load($entity->vid);
    $entity->vocabulary_machine_name = $vocabulary ? $vocabulary->machine_name : NULL;
  }
  return $entity;
}