src/snac/server/database/DBUtil.php
/**
     * Search Vocabulary
     *
     * Searches the vocabulary and returns an array of id, value pairs.
     *
     * @param string $type vocabulary type
     * @param string $query search string
     * @param int $entityTypeID optional The vocabulary.id of one of the 3 entity type records. Used for selecting
     * name component vocabulary sensitive to context of entity type.
     * @param int $count optional The number of search results to request
     * @return string[][] list of results
     */
Search Vocabulary
Searches the vocabulary and returns an array of id, value pairs.

@param string $type vocabulary type
@param string $query search string
@param int $entityTypeID optional The vocabulary.id of one of the 3 entity type records. Used for selecting
name component vocabulary sensitive to context of entity type.
@param int $count optional The number of search results to request
@return string[][] list of results
Search Vocabulary Searches the vocabulary and returns an array of id value pairs . @param string $type vocabulary type @param string $query search string @param int $entityTypeID optional The vocabulary . id of one of the 3 entity type records . Used for selecting name component vocabulary sensitive to context of entity type . @param int $count optional The number of search results to request @return string [] [] list of results
public function searchVocabulary($type, $query, $entityTypeID=null, $count=100) {
        if ($type == 'geo_place') {
            $results = $this->sql->searchPlaceVocabulary($query);
            $retVal = array();
            foreach ($results as $data) {
                $place = new \snac\data\GeoTerm();
                $place->setAdministrationCode($data["admin_code"]);
                $place->setCountryCode($data["country_code"]);
                $place->setID($data["id"]);
                $place->setLatitude($data["latitude"]);
                $place->setLongitude($data["longitude"]);
                $place->setName($data["name"]);
                $place->setURI($data["uri"]);
                array_push($retVal, $place);
            }
            return $retVal;
        }
        $results = $this->sql->searchVocabulary($type, $query, $entityTypeID, $count);
        $vocabList = array();
        foreach ($results as $result) {
            $term = new \snac\data\Term();
            if (isset($result["id"]))
                $term->setID($result["id"]);
            if (isset($result["uri"]))
                $term->setURI($result["uri"]);
            if (isset($result["value"]))
                $term->setTerm($result["value"]);
            if (isset($result["type"]))
                $term->setType($result["type"]);
            if (isset($result["description"]))
                $term->setDescription($result["description"]);
            array_push($vocabList, $term);
        }
        return $vocabList;
    }
public function searchVocabulary ( $ type , $ query , $ entityTypeID = null , $ count = 100 ) { if ( $ type == 'geo_place' ) { $ results = $ this -> sql -> searchPlaceVocabulary ( $ query ) ; $ retVal = array ( ) ; foreach ( $ results as $ data ) { $ place = new \ snac \ data \ GeoTerm ( ) ; $ place -> setAdministrationCode ( $ data [ " admin_code " ] ) ; $ place -> setCountryCode ( $ data [ " country_code " ] ) ; $ place -> setID ( $ data [ " id " ] ) ; $ place -> setLatitude ( $ data [ " latitude " ] ) ; $ place -> setLongitude ( $ data [ " longitude " ] ) ; $ place -> setName ( $ data [ " name " ] ) ; $ place -> setURI ( $ data [ " uri " ] ) ; array_push ( $ retVal , $ place ) ; } return $ retVal ; } $ results = $ this -> sql -> searchVocabulary ( $ type , $ query , $ entityTypeID , $ count ) ; $ vocabList = array ( ) ; foreach ( $ results as $ result ) { $ term = new \ snac \ data \ Term ( ) ; if ( isset ( $ result [ " id " ] ) ) $ term -> setID ( $ result [ " id " ] ) ; if ( isset ( $ result [ " uri " ] ) ) $ term -> setURI ( $ result [ " uri " ] ) ; if ( isset ( $ result [ " value " ] ) ) $ term -> setTerm ( $ result [ " value " ] ) ; if ( isset ( $ result [ " type " ] ) ) $ term -> setType ( $ result [ " type " ] ) ; if ( isset ( $ result [ " description " ] ) ) $ term -> setDescription ( $ result [ " description " ] ) ; array_push ( $ vocabList , $ term ) ; } return $ vocabList ; }
Search Vocabulary
 Searches the vocabulary and returns an array of id, value pairs.
Search Vocabulary Searches the vocabulary and returns an array of id value pairs .