src/snac/server/ServerExecutor.php
/**
     * Read Vocabulary
     *
     * Reads the vocabulary from the database, based on the input given and returns
     * the result
     *
     * @param string[] $input Direct server input
     * @return string[] The response to send to the client
     */
Read Vocabulary
Reads the vocabulary from the database, based on the input given and returns
the result

@param string[] $input Direct server input
@return string[] The response to send to the client
Read Vocabulary Reads the vocabulary from the database based on the input given and returns the result @param string [] $input Direct server input @return string [] The response to send to the client
public function readVocabulary(&$input) {
        $response = array();
        $term = null;
        if (isset($input["term_id"])) {
            if (isset($input["type"]) && $input["type"] == "geoPlace") {
                $term = $this->cStore->buildGeoTerm($input["term_id"]);
            } else {
                $term = $this->cStore->populateTerm($input["term_id"]);
            }
        } elseif (isset($input["term_value"]) && isset($input["type"])) {
            $term = $this->cStore->populateTerm(null, $input["term_value"], $input["type"]);
        } elseif (isset($input["uri"])) {
            $term = $this->cStore->populateTerm(null, null, null, $input["uri"]);
        }
        if ($term !== null) {
            $response["term"] = $term->toArray();
            $response["result"] = "success";
        } else {
            $response["term"] = null;
            $response["result"] = "failure";
        }
        return $response;
    }
public function readVocabulary ( & $ input ) { $ response = array ( ) ; $ term = null ; if ( isset ( $ input [ " term_id " ] ) ) { if ( isset ( $ input [ " type " ] ) && $ input [ " type " ] == " geoPlace " ) { $ term = $ this -> cStore -> buildGeoTerm ( $ input [ " term_id " ] ) ; } else { $ term = $ this -> cStore -> populateTerm ( $ input [ " term_id " ] ) ; } } elseif ( isset ( $ input [ " term_value " ] ) && isset ( $ input [ " type " ] ) ) { $ term = $ this -> cStore -> populateTerm ( null , $ input [ " term_value " ] , $ input [ " type " ] ) ; } elseif ( isset ( $ input [ " uri " ] ) ) { $ term = $ this -> cStore -> populateTerm ( null , null , null , $ input [ " uri " ] ) ; } if ( $ term !== null ) { $ response [ " term " ] = $ term -> toArray ( ) ; $ response [ " result " ] = " success " ; } else { $ response [ " term " ] = null ; $ response [ " result " ] = " failure " ; } return $ response ; }
Read Vocabulary
 Reads the vocabulary from the database, based on the input given and returns
 the result
Read Vocabulary Reads the vocabulary from the database based on the input given and returns the result