function RulesTaxonomyVocabularyWrapper::setEntity

Overridden to support identifying vocabularies by machine names.

File

modules/rules_core.eval.inc, line 258

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);
    }
}