Skip to content

Commit 6643f00

Browse files
author
Josh Freeman
committed
Fix array handling in search
1 parent ba83f02 commit 6643f00

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

cli

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ $api = new \XIVAPI\XIVAPI();
1212
// set env key
1313
$api->environment->key('my_api_key');
1414

15-
$queries = [
16-
'limit' => 500,
17-
'columns' => [
18-
'ID',
19-
'Name'
20-
]
21-
];
15+
$items = $api->search
16+
->indexes(['item'])
17+
->filter('ItemSearchCategory.ID', 10, \XIVAPI\Api\SearchFilters::EQUAL_TO)
18+
->limit(500)
19+
->sort('LevelItem', 'desc')
20+
->columns(['ID','Name'])
21+
->results();
2222

23-
// do commands
24-
$results = $api->queries($queries)->content->Item()->list();
25-
26-
print_r($results);
23+
print_r($items);

src/XIVAPI/Api/Search.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function results()
3737
continue;
3838
}
3939

40+
$value = is_array($value) ? implode(',', $value) : $value;
4041
$options[RequestOptions::QUERY][$field] = $value;
4142
}
4243

0 commit comments

Comments
 (0)