public function fetch()
    {
        $this->logQueryStart();
        $results = null;

        if (is_array($this->termLookupMode)) {
            $queryLog = "get_term_by(" . Debugger::export($this->termLookupMode[0]) . ", " . Debugger::export($this->termLookupMode[1]) . ", " . Debugger::export($this->taxnomony) . ")";
            $results = get_term_by($this->termLookupMode[0], $this->termLookupMode[1], $this->taxnomony);
        } elseif (is_null($this->postId)) {
            $queryLog = "get_terms(" . Debugger::export($this->taxnomony) . ", " . Debugger::export($this->filters) . ")";
            $results = get_terms($this->taxnomony, $this->filters);
        } else {
            $queryLog = "get_the_terms(" . Debugger::export($this->postId) . ", " . Debugger::export($this->taxnomony) . ", " . Debugger::export($this->filters) . ")";
            $results = get_the_terms($this->postId, $this->taxnomony, $this->filters);
        }

        $this->logQueryCompletion($queryLog);

        if ($results === false) {
            return array();
        }

        if (!is_array($results)) {
            $results = array($results);
        }

        return $results;
    }
public function fetch()
    {
        $this->logQueryStart();
        $results = null;

        if (is_array($this->termLookupMode)) {
            $queryLog = "get_term_by(" . Debugger::export($this->termLookupMode[0]) . ", " . Debugger::export($this->termLookupMode[1]) . ", " . Debugger::export($this->taxnomony) . ")";
            $results = get_term_by($this->termLookupMode[0], $this->termLookupMode[1], $this->taxnomony);
        } elseif (is_null($this->postId)) {
            $queryLog = "get_terms(" . Debugger::export($this->taxnomony) . ", " . Debugger::export($this->filters) . ")";
            $results = get_terms($this->taxnomony, $this->filters);
        } else {
            $queryLog = "get_the_terms(" . Debugger::export($this->postId) . ", " . Debugger::export($this->taxnomony) . ", " . Debugger::export($this->filters) . ")";
            $results = get_the_terms($this->postId, $this->taxnomony, $this->filters);
        }

        $this->logQueryCompletion($queryLog);

        if ($results === false) {
            return array();
        }

        if (!is_array($results)) {
            $results = array($results);
        }

        return $results;
    }
public function fetch ( ) { $ this -> logQueryStart ( ) ; $ results = null ; if ( is_array ( $ this -> termLookupMode ) ) { $ queryLog = "get_term_by(" . Debugger :: export ( $ this -> termLookupMode [ 0 ] ) . ", " . Debugger :: export ( $ this -> termLookupMode [ 1 ] ) . ", " . Debugger :: export ( $ this -> taxnomony ) . ")" ; $ results = get_term_by ( $ this -> termLookupMode [ 0 ] , $ this -> termLookupMode [ 1 ] , $ this -> taxnomony ) ; } elseif ( is_null ( $ this -> postId ) ) { $ queryLog = "get_terms(" . Debugger :: export ( $ this -> taxnomony ) . ", " . Debugger :: export ( $ this -> filters ) . ")" ; $ results = get_terms ( $ this -> taxnomony , $ this -> filters ) ; } else { $ queryLog = "get_the_terms(" . Debugger :: export ( $ this -> postId ) . ", " . Debugger :: export ( $ this -> taxnomony ) . ", " . Debugger :: export ( $ this -> filters ) . ")" ; $ results = get_the_terms ( $ this -> postId , $ this -> taxnomony , $ this -> filters ) ; } $ this -> logQueryCompletion ( $ queryLog ) ; if ( $ results === false ) { return array ( ) ; } if ( ! is_array ( $ results ) ) { $ results = array ( $ results ) ; } return $ results ; }
Fetches the terms matching the TaxonomyQuery.
@return array
Fetches the terms matching the TaxonomyQuery .