/** * @return TaxonomyTerm[]|array */ protected function getTerms() { if (empty($this->_terms)) { $vocabularies = TaxonomyVocabulary::getModelsArray(); if (isset($vocabularies[$this->vocabularyName])) { $this->_terms = TaxonomyTermHierarchy::getTree($vocabularies[$this->vocabularyName]->id); } } return $this->_terms; }
/** * @param $name string * @return TaxonomyVocabulary|null */ protected function getVocabularyByName($name) { $models = TaxonomyVocabulary::getModelsArray(); return isset($models[$name]) ? $models[$name] : false; }