Hi everyone,
In a Omeka S theme, I would like to use the option returnScalar in a API search request. Here is my code:
$options = [];
$item_ids = $this->api()->search('items', $options, ['returnScalar' => 'id'])->getContent();
print_r(json_encode($item_ids));
but the result is not what I expect: instead of an array of IDs, I get an array of item representations.
I wrote the equivalent code in a module, and the result is indeed an array of IDs. The code in the module:
$options = [];
$item_ids = $api->search('items', $options, ['returnScalar' => 'id'])->getContent();
$logger->notice($item_ids);
How can I get an array of IDs with returnScalar in a theme?
Vincent