src/MessageHandler/Query/MeOnMap/GetCategoriesWithGeoLocationsHandler.php line 21

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Slivki\MessageHandler\Query\MeOnMap;
  4. use Slivki\Message\Query\MeOnMap\GetCategoriesWithGeoLocationsQuery;
  5. use Slivki\Response\MeOnMap\GetCategoriesWithGeoLocationsResponse;
  6. use Slivki\Services\MeOnMap\GetCategoriesWithGeoLocationsResponseCacheService;
  7. use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
  8. final class GetCategoriesWithGeoLocationsHandler implements MessageHandlerInterface
  9. {
  10.     private GetCategoriesWithGeoLocationsResponseCacheService $cacheService;
  11.     public function __construct(GetCategoriesWithGeoLocationsResponseCacheService $cacheService)
  12.     {
  13.         $this->cacheService $cacheService;
  14.     }
  15.     public function __invoke(GetCategoriesWithGeoLocationsQuery $query): GetCategoriesWithGeoLocationsResponse
  16.     {
  17.         return $this->cacheService->getByCityId($query->getCityId());
  18.     }
  19. }