public function testConstruct() { $dataset = uniqid(); $search = new Search($dataset); $this->assertEquals($dataset, $search->getDataset()); $this->assertCount(1, $search->getParameters()); }
/** * 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; }