/** * Get all terms in the given taxonomy. * * @param string|\Tev\Taxonomy\Model\Taxonomy $taxonomy Taxonomy object or name * @return \Tev\Term\Model\Term[] */ public function getByTaxonomy($taxonomy) { if (!$taxonomy instanceof Taxonomy) { $taxonomy = $this->taxonomyFactory->create($taxonomy); } return $this->convertTermsArray(get_terms($taxonomy->getName(), array('hide_empty' => false)), $taxonomy); }
/** * Get Term Taxonomy. * * @return \Tev\Taxonomy\Model\Taxonomy */ public function taxonomy() { if ($this->_taxonomy === null) { $this->_taxonomy = $this->taxonomyFactory->create($this->base['taxonomy']); } return $this->_taxonomy; }
/** * Get all terms for this post in the given taxonomy. * * @param mixed|\Tev\Taxonomy\Model\Taxonomy $taxonomy Taxonomy name or object * @return \Tev\Term\Model\Term[] Array of terms */ public function getTermsFor($taxonomy) { if (!$taxonomy instanceof Taxonomy) { $taxonomy = $this->taxonomyFactory->create($taxonomy); } return $taxonomy->getTermsForPost($this); }