/** * @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; }
/** * @return TaxonomyTerm[] */ public function getTree() { return TaxonomyTermHierarchy::getTree($this->id); }
public function afterSave($insert, $changedAttributes) { TaxonomyTermHierarchy::addChild($this->id, $this->vid, $this->getParent() ? $this->getParent()->id : 0); parent::afterSave($insert, $changedAttributes); }