Esempio n. 1
0
 /**
  * @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;
 }
Esempio n. 2
0
 /**
  * @param $name string
  * @return TaxonomyVocabulary|null
  */
 protected function getVocabularyByName($name)
 {
     $models = TaxonomyVocabulary::getModelsArray();
     return isset($models[$name]) ? $models[$name] : false;
 }