Skip to content
Snippets Groups Projects
SearchQueryHandler.php 459 B
Newer Older
Pavel's avatar
Pavel committed
<?php

namespace IQDEV\Search\Query;

use IQDEV\Search\SearchService;

final class SearchQueryHandler
{
    private SearchService $searchService;

    public function __construct(SearchService $searchService)
    {
        $this->searchService = $searchService;
    }

    public function handle(SearchQuery $q): SearchQueryResponse
    {
        $result = $this->searchService->search($q->criteria);

        return new SearchQueryResponse($result);
    }
}