コード例 #1
0
 public function testConstruct()
 {
     $dataset = uniqid();
     $search = new Search($dataset);
     $this->assertEquals($dataset, $search->getDataset());
     $this->assertCount(1, $search->getParameters());
 }
コード例 #2
0
 /**
  * Look locally (parsers)
  *
  * @param Search $search
  *
  * @return array|false
  */
 private function searchDistant(Search $search)
 {
     $data = array();
     $result = $this->client->get('search', $search->getParameters());
     if ($result) {
         $result = json_decode($result, true);
         foreach ($result['records'] as $record) {
             $data[] = $record['fields'];
         }
     }
     return $data;
 }