add() public method

Adds name/key pair to query for eventual resolution
public add ( $key, $val )
Ejemplo n.º 1
0
 /**
  * Resolves and returns resolved entity or null (shortcut method)
  * @param string tableName Table name
  * @param array vars Attributes of entity to be matched in key=>value pairs
  * @return object ResolveResponse
  */
 public function resolve($tableName, $vars)
 {
     $query = new ResolveQuery();
     foreach ($vars as $key => $value) {
         $query->add($key, $value);
     }
     $res = new ResolveResponse($this->request($this->urlForResolve($tableName, $query)));
     return $res;
 }
Ejemplo n.º 2
0
 private function testResolve()
 {
     $query = $this->getQueryObject();
     $query = new ResolveQuery();
     $query->add("name", "Buena Vista Cigar Club");
     $query->add("latitude", 34.06);
     $query->add("longitude", -118.4);
     try {
         $res = $this->factual->fetch($this->testTables['resolve'], $query);
     } catch (Exception $e) {
         $this->msg(__METHOD__, false, $e->getMessage());
     }
     if ($res->getStatus() == "ok") {
         $this->msg("Resolve Endpoint", true);
     } else {
         $this->msg("Resolve Endpoint", false);
     }
 }