You are here

protected function RulesTaxonomyVocabularyWrapper::setEntity in Rules 7.2

Overridden to support identifying vocabularies by machine names.

Overrides EntityDrupalWrapper::setEntity

File

modules/rules_core.eval.inc, line 256
Contains rules core integration needed during evaluation.

Class

RulesTaxonomyVocabularyWrapper
A custom wrapper class for vocabularies.

Code

protected function setEntity($data) {
  if (isset($data) && $data !== FALSE && !is_object($data) && !is_numeric($data)) {

    // The vocabulary name has been passed.
    parent::setEntity(taxonomy_vocabulary_machine_name_load($data));
  }
  else {
    parent::setEntity($data);
  }
}