Adds collection API #3

Merged
chris merged 5 commits from collection-api into develop 2021-11-10 14:04:18 +01:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 52c86af842 - Show all commits

View File

@ -10,9 +10,7 @@ return [
//'type' => \Laminas\Router\Http\Segment::class,
'type' => \Laminas\Router\Http\Literal::class,
'options' => [
//'route' => '/collections[/:action]',
//'route' => '/collections',
'route' => '/collections/search',
'route' => '/api/collections/search',
'defaults' => [
'__NAMESPACE__' => 'ArchiveSiteMeta\Controller',
'controller' => Controller\ArchiveSiteMetaController::class,

View File

@ -52,7 +52,9 @@ class ArchiveSiteMetaController extends AbstractActionController
array_push($query_results, $site->id());
}
}
$pages = $this->api()->search('site_pages', $resources['site_pages']['query'], ['returnScalar' => 'site'])->getContent();
$pages = $this->api()->search('site_pages',
$resources['site_pages']['query'],
['returnScalar' => 'site'])->getContent();
foreach($pages as $page) {
array_push($query_results, (int)$page);
}