src/Controller/ProfileListController.php line 739

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by simpson <simpsonwork@gmail.com>
  4.  * Date: 2019-03-19
  5.  * Time: 22:28
  6.  */
  7. namespace App\Controller;
  8. use App\Bridge\Porpaginas\Doctrine\ORM\FakeORMQueryPage;
  9. use App\Dto\ProfileListSpecification;
  10. use App\Entity\Location\City;
  11. use App\Entity\Location\County;
  12. use App\Entity\Location\District;
  13. use App\Entity\Location\Station;
  14. use App\Entity\Profile\BodyTypes;
  15. use App\Entity\Profile\BreastTypes;
  16. use App\Entity\Profile\Genders;
  17. use App\Entity\Profile\HairColors;
  18. use App\Entity\Profile\Nationalities;
  19. use App\Entity\Profile\PrivateHaircuts;
  20. use App\Entity\Service;
  21. use App\Entity\ServiceGroups;
  22. use App\Entity\TakeOutLocations;
  23. use App\Repository\ServiceRepository;
  24. use App\Repository\StationRepository;
  25. use App\Service\CountryCurrencyResolver;
  26. use App\Service\DefaultCityProvider;
  27. use App\Service\Features;
  28. use App\Service\HomepageCityListingsBlockProvider;
  29. use App\Service\ListingRotationApi;
  30. use App\Service\ListingService;
  31. use App\Service\ProfileList;
  32. use App\Service\ProfileListingAppliedFiltersResolver;
  33. use App\Service\ProfileListingRecommendationsFiller;
  34. use App\Service\ProfileListingDataCreator;
  35. use App\Service\ProfileListSpecificationService;
  36. use App\Service\ProfileFilterService;
  37. use App\Service\ProfileNameLandingProvider;
  38. use App\Service\ProfileTopBoard;
  39. use App\Service\Top100ProfilesService;
  40. use App\Specification\ElasticSearch\ISpecification;
  41. use App\Specification\Profile\ProfileHasApartments;
  42. use App\Specification\Profile\ProfileHasComments;
  43. use App\Specification\Profile\ProfileHasVideo;
  44. use App\Specification\Profile\ProfileIdIn;
  45. use App\Specification\Profile\ProfileIdINOrderedByINValues;
  46. use App\Specification\Profile\ProfileIdNotIn;
  47. use App\Specification\Profile\ProfileIsApproved;
  48. use App\Specification\Profile\ProfileIsElite;
  49. use App\Specification\Profile\ProfileIsLocated;
  50. use App\Specification\Profile\ProfileIsProvidingOneOfServices;
  51. use App\Specification\Profile\ProfileIsProvidingTakeOut;
  52. use App\Specification\Profile\ProfilePriceThresholds;
  53. use App\Specification\Profile\ProfileWithAge;
  54. use App\Specification\Profile\ProfileWithBodyType;
  55. use App\Specification\Profile\ProfileWithBreastType;
  56. use App\Specification\Profile\ProfileWithHairColor;
  57. use App\Specification\Profile\ProfileWithNationality;
  58. use App\Specification\Profile\ProfileWithApartmentsOneHourPrice;
  59. use App\Specification\Profile\ProfileWithPrivateHaircut;
  60. use Flagception\Bundle\FlagceptionBundle\Annotations\Feature;
  61. use Happyr\DoctrineSpecification\Filter\Filter;
  62. use Happyr\DoctrineSpecification\Logic\OrX;
  63. use OpenApi\Attributes as OA;
  64. use Porpaginas\Doctrine\ORM\ORMQueryResult;
  65. use Porpaginas\Page;
  66. use Psr\Cache\CacheItemPoolInterface;
  67. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
  68. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Entity;
  69. use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
  70. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  71. use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
  72. use Symfony\Component\HttpFoundation\JsonResponse;
  73. use Symfony\Component\HttpFoundation\Request;
  74. use Happyr\DoctrineSpecification\Spec;
  75. use Symfony\Component\HttpFoundation\RequestStack;
  76. use Symfony\Component\HttpFoundation\Response;
  77. use Symfony\Component\Routing\Annotation\Route;
  78. use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
  79. /**
  80.  * @see \App\Console\Export\ExportRotationListingsConfigCommand for listing API endpoints
  81.  */
  82. #[Cache(maxage60, public: true)]
  83. class ProfileListController extends AbstractController
  84. {
  85.     use ExtendedPaginationTrait;
  86.     use SpecTrait;
  87.     use ProfileMinPriceTrait;
  88.     use ResponseTrait;
  89.     const ENTRIES_ON_PAGE 36;
  90.     const RESULT_SOURCE_COUNTY 'county';
  91.     const RESULT_SOURCE_DISTRICT 'district';
  92.     const RESULT_SOURCE_STATION 'station';
  93.     const RESULT_SOURCE_APPROVED 'approved';
  94.     const RESULT_SOURCE_WITH_COMMENTS 'with_comments';
  95.     const RESULT_SOURCE_WITH_VIDEO 'with_video';
  96.     const RESULT_SOURCE_WITH_SELFIE 'with_selfie';
  97.     const RESULT_SOURCE_TOP_100 'top_100';
  98.     const RESULT_SOURCE_ELITE 'elite';
  99.     const RESULT_SOURCE_MASSEURS 'masseurs';
  100.     const RESULT_SOURCE_MASSAGE_SERVICE 'massage_service';
  101.     const RESULT_SOURCE_BY_PARAMS 'by_params';
  102.     const RESULT_SOURCE_SERVICE 'service';
  103.     const RESULT_SOURCE_CITY 'city';
  104.     const RESULT_SOURCE_COUNTRY 'country';
  105.     const RESULT_SOURCE_WITH_WHATSAPP 'with_whatsapp';
  106.     const RESULT_SOURCE_WITH_TELEGRAM 'with_telegram';
  107.     const RESULT_SOURCE_EIGHTEEN_YEARS_OLD 'eighteen_years_old';
  108.     const RESULT_SOURCE_BIG_ASS 'big_ass';
  109.     const RESULT_SOURCE_WITH_TATTOO 'with_tattoo';
  110.     const RESULT_SOURCE_WITH_PIERCING 'with_piercing';
  111.     const RESULT_SOURCE_ROUND_THE_CLOCK 'round_the_clock';
  112.     const RESULT_SOURCE_FOR_TWO_HOURS 'for_two_hours';
  113.     const RESULT_SOURCE_FOR_HOUR 'for_hour';
  114.     const RESULT_SOURCE_EXPRESS_PROGRAM 'express_program';
  115.     const RESULT_SOURCE_EROMASSAGE 'eromassage';
  116.     const RESULT_SOURCE_VERIFIED 'verified';
  117.     const RESULT_SOURCE_CHEAP 'cheap';
  118.     const RESULT_SOURCE_MATURE 'mature';
  119.     const RESULT_SOURCE_UZBEK 'uzbek';
  120.     private ?string $source null;
  121.     public function __construct(
  122.         private RequestStack $requestStack,
  123.         private ProfileList                     $profileList,
  124.         private CountryCurrencyResolver         $countryCurrencyResolver,
  125.         private ServiceRepository               $serviceRepository,
  126.         private ListingService                  $listingService,
  127.         private Features                        $features,
  128.         private ProfileFilterService            $profilesFilterService,
  129.         private ProfileListSpecificationService $profileListSpecificationService,
  130.         private ProfileListingDataCreator       $profileListingDataCreator,
  131.         private Top100ProfilesService           $top100ProfilesService,
  132.         private CacheItemPoolInterface          $stationAddedProfilesCache,
  133.         private ParameterBagInterface           $parameterBag,
  134.         private ListingRotationApi              $listingRotationApi,
  135.         private ProfileTopBoard                 $profileTopBoard,
  136.         private HomepageCityListingsBlockProvider $homepageCityListingsBlockProvider,
  137.         private ProfileListingRecommendationsFiller $profileListingRecommendationsFiller,
  138.         private ProfileListingAppliedFiltersResolver $listingAppliedFiltersResolver,
  139.         private NormalizerInterface $normalizer,
  140.         private ProfileNameLandingProvider $profileNameLandingProvider,
  141.     ) {}
  142.     /**
  143.      * @param Page|array $result
  144.      */
  145.     protected function jsonListingResponse($resultCity $city, ?ProfileListSpecification $specs null, array $extra = []): JsonResponse
  146.     {
  147.         $filters $this->listingAppliedFiltersResolver->resolve($city$specs);
  148.         if (is_array($result)) {
  149.             return $this->json(array_merge(['filters' => $filters], $result$extra));
  150.         }
  151.         $normalized $this->normalizer->normalize($result);
  152.         if (!is_array($normalized)) {
  153.             $normalized = ['data' => $normalized];
  154.         }
  155.         return $this->json(array_merge(['filters' => $filters], $normalized$extra));
  156.     }
  157.     /**
  158.      * @Feature("has_masseurs")
  159.      */
  160.     #[ParamConverter("city"converter"city_converter")]
  161.     #[Route("/api/profiles/listing/city/{city}/masseur"name"api.profile_listing.masseur"methods"GET"format"json")]
  162.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  163.     #[OA\Tag(name"ProfileListing")]
  164.     #[OA\Response(
  165.         response200,
  166.         description'',
  167.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  168.     )]
  169.     public function listForMasseur(Request $requestCity $cityServiceRepository $serviceRepository): Response
  170.     {
  171.         $specs $this->profileListSpecificationService->listForMasseur($city);
  172.         $response = new Response();
  173.         $massageGroupServices $serviceRepository->findBy(['group' => ServiceGroups::MASSAGE]);
  174.         $alternativeSpec $this->getORSpecForItemsArray([$massageGroupServices], function($item): ProfileIsProvidingOneOfServices {
  175.             return new ProfileIsProvidingOneOfServices($item);
  176.         });
  177.         $result $this->paginatedListing($city'/city/{city}/masseur', ['city' => $city->getId()], $specs->spec(), $alternativeSpecself::RESULT_SOURCE_MASSAGE_SERVICE$response);
  178.         if ($this->isApiRequest($request)) {
  179.             return $this->jsonListingResponse($result$city$specs);
  180.         }
  181.         return $this->render('ProfileList/list.html.twig', [
  182.             'profiles' => $result,
  183.             'source' => $this->source,
  184.             'source_default' => self::RESULT_SOURCE_MASSEURS,
  185.             'recommendationSpec' => $specs->recommendationSpec(),
  186.         ], response$response);
  187.     }
  188.     /**
  189.      * @Feature("extra_category_big_ass")
  190.      */
  191.     #[ParamConverter("city"converter"city_converter")]
  192.     #[Route("/api/profiles/listing/city/{city}/category/big_ass"name"api.profile_listing.category.big_ass"methods"GET"format"json")]
  193.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  194.     #[OA\Tag(name"ProfileListing")]
  195.     #[OA\Response(
  196.         response200,
  197.         description'',
  198.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  199.     )]
  200.     public function listBigAss(Request $requestCity $city): Response
  201.     {
  202.         $specs $this->profileListSpecificationService->listBigAss();
  203.         $response = new Response();
  204.         $result $this->paginatedListing($city'/city/{city}/category/big_ass', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  205.         if ($this->isApiRequest($request)) {
  206.             return $this->jsonListingResponse($result$city$specs);
  207.         }
  208.         return $this->render('ProfileList/list.html.twig', [
  209.             'profiles' => $result,
  210.             'source' => $this->source,
  211.             'source_default' => self::RESULT_SOURCE_BIG_ASS,
  212.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  213.                 'city' => $city->getUriIdentity(),
  214.                 'page' => $this->getCurrentPageNumber(),
  215.             ]),
  216.             'recommendationSpec' => $specs->recommendationSpec(),
  217.         ], response$response);
  218.     }
  219.     public function listByDefaultCity(ParameterBagInterface $parameterBagRequest $request): Response
  220.     {
  221.         $controller get_class($this).'::listByCity';
  222.         $path = [
  223.             'city' => $parameterBag->get('default_city'),
  224.             'subRequest' => true,
  225.         ];
  226.         //чтобы в обработчике можно было понять, по какому роуту зашли
  227.         $request->request->set('_route''profile_list.list_by_city');
  228.         return $this->forward($controller$path);
  229.     }
  230.     private function paginatedListing(City $city, ?string $apiEndpoint, array $apiParams, ?Filter $listingSpec null, ?OrX $alternativeSpec null, ?string $alternativeSource null, ?Response $response null): Page
  231.     {
  232.         $topPlacement $this->profileTopBoard->topPlacementSatisfiedBy($city$listingSpec);
  233.         $topPlacement?->setTopCard(); // mark as top card for UI
  234.         $page $this->getCurrentPageNumber();
  235.         $apiParams['city'] = $city->getId();
  236.         try {
  237.             if (null === $apiEndpoint) {
  238.                 throw new \RuntimeException('Empty API endpoint to switch to legacy listing query.');
  239.             }
  240.             $result $this->listingRotationApi->paginate($apiEndpoint$apiParams$page$topPlacement);
  241.             $response?->setMaxAge(10);
  242.         } catch (\Exception) {
  243.             $avoidOrTopPlacement = (null !== $topPlacement && $page 2) ? $topPlacement null;
  244.             $result $this->profileList->list($citynull$listingSpec, [], truenullProfileList::ORDER_BY_STATUS,
  245.                 nulltruenull, [Genders::FEMALE], $avoidOrTopPlacement);
  246.         }
  247.         return $result;
  248.     }
  249.     #[ParamConverter("city"converter"city_converter")]
  250.     #[Route("/api/profiles/listing/city/{city}"name"api.profile_listing.by_city"methods"GET"format"json")]
  251.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  252.     #[OA\Tag(name"ProfileListing")]
  253.     #[OA\Response(
  254.         response200,
  255.         description'Листинг анкет по городу',
  256.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  257.     )]
  258.     public function listByCity(ParameterBagInterface $parameterBagRequest $requestCity $citybool $subRequest false): Response
  259.     {
  260.         $page $this->getCurrentPageNumber();
  261.         if ($this->features->redirect_default_city_to_homepage() && false === $subRequest && $city->equals($parameterBag->get('default_city')) && $page 2) {
  262.             return $this->redirectToRoute('homepage', [], 301);
  263.         }
  264.         $specs $this->profileListSpecificationService->listByCity();
  265.         $response = new Response();
  266.         $result $this->paginatedListing($city'/city/{city}', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  267.         if ($this->isApiRequest($request)) {
  268.             return $this->jsonListingResponse($result$city$specs);
  269.         }
  270.         $homepageCityListingsBlock null;
  271.         if ($this->shouldShowHomepageCityListingsBlock($city$page$subRequest)) {
  272.             $homepageCityListingsBlock $this->homepageCityListingsBlockProvider->getForCity($city);
  273.         }
  274.         return $this->render('ProfileList/list.html.twig', [
  275.             'profiles' => $result,
  276.             'homepage_city_listings_block' => $homepageCityListingsBlock,
  277.             'recommendationSpec' => $specs->recommendationSpec(),
  278.         ], response$response);
  279.     }
  280.     /**
  281.      * @Feature("intim_moscow_listing")
  282.      */
  283.     #[Cache(maxage3600, public: true)]
  284.     #[Route("/api/profiles/listing/city/{city}/intim"name"api.profile_listing.intim"methods"GET"format"json")]
  285.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  286.     #[OA\Tag(name"ProfileListing")]
  287.     #[OA\Response(
  288.         response200,
  289.         description'',
  290.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  291.     )]
  292.     public function listIntim(Request $requestDefaultCityProvider $defaultCityProvider): Response
  293.     {
  294.         $city $defaultCityProvider->getDefaultCity();
  295.         $request->attributes->set('city'$city);
  296.         $specs $this->profileListSpecificationService->listByCity();
  297.         $response = new Response();
  298.         $result $this->paginatedListing($city'/city/{city}/intim', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  299.         $result $this->shuffleProfilesOnPage($result);
  300.         $response->setMaxAge(3600);
  301.         if ($this->isApiRequest($request)) {
  302.             return $this->jsonListingResponse($result$city$specs);
  303.         }
  304.         return $this->render('ProfileList/list.html.twig', [
  305.             'profiles' => $result,
  306.             'city' => $city,
  307.             'recommendationSpec' => $specs->recommendationSpec(),
  308.         ], response$response);
  309.     }
  310.     #[ParamConverter("city"converter"city_converter")]
  311.     #[Entity("county"expr"repository.ofUriIdentityWithinCity(county, city)")]
  312.     #[Route("/api/profiles/listing/city/{city}/county/{county}"name"api.profile_listing.by_county"methods"GET"format"json")]
  313.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  314.     #[OA\Tag(name"ProfileListing")]
  315.     #[OA\Response(
  316.         response200,
  317.         description'',
  318.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  319.     )]
  320.     public function listByCounty(Request $requestCity $cityCounty $county): Response
  321.     {
  322.         if (!$city->hasCounty($county)) {
  323.             throw $this->createNotFoundException();
  324.         }
  325.         $specs $this->profileListSpecificationService->listByCounty($county);
  326.         $response = new Response();
  327.         $alternativeSpec Spec::orX(ProfileIsLocated::withinCounties($city$city->getCounties()->toArray()));
  328.         $result $this->paginatedListing($city'/city/{city}/county/{county}', ['city' => $city->getId(), 'county' => $county->getId()], $specs->spec(), $alternativeSpecself::RESULT_SOURCE_COUNTY$response);
  329.         if ($this->isApiRequest($request)) {
  330.             return $this->jsonListingResponse($result$city$specs);
  331.         }
  332.         return $this->render('ProfileList/list.html.twig', [
  333.             'profiles' => $result,
  334.             'source' => $this->source,
  335.             'source_default' => self::RESULT_SOURCE_COUNTY,
  336.             'county' => $county,
  337.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  338.                 'city' => $city->getUriIdentity(),
  339.                 'county' => $county->getUriIdentity(),
  340.                 'page' => $this->getCurrentPageNumber()
  341.             ]),
  342.             'recommendationSpec' => $specs->recommendationSpec(),
  343.         ], response$response);
  344.     }
  345.     #[ParamConverter("city"converter"city_converter")]
  346.     #[Entity("district"expr"repository.ofUriIdentityWithinCity(district, city)")]
  347.     #[Route("/api/profiles/listing/city/{city}/district/{district}"name"api.profile_listing.by_district"methods"GET"format"json")]
  348.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  349.     #[OA\Tag(name"ProfileListing")]
  350.     #[OA\Response(
  351.         response200,
  352.         description'',
  353.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  354.     )]
  355.     public function listByDistrict(Request $requestCity $cityDistrict $district): Response
  356.     {
  357.         if (!$city->hasDistrict($district)) {
  358.             throw $this->createNotFoundException();
  359.         }
  360.         $specs $this->profileListSpecificationService->listByDistrict($district);
  361.         $response = new Response();
  362.         $alternativeSpec Spec::orX(ProfileIsLocated::withinDistricts($city$city->getDistricts()->toArray()));
  363.         $result $this->paginatedListing($city'/city/{city}/district/{district}', ['city' => $city->getId(), 'district' => $district->getId()], $specs->spec(), $alternativeSpecself::RESULT_SOURCE_DISTRICT$response);
  364.         if ($this->isApiRequest($request)) {
  365.             return $this->jsonListingResponse($result$city$specs);
  366.         }
  367.         return $this->render('ProfileList/list.html.twig', [
  368.             'profiles' => $result,
  369.             'source' => $this->source,
  370.             'source_default' => self::RESULT_SOURCE_DISTRICT,
  371.             'district' => $district,
  372.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  373.                 'city' => $city->getUriIdentity(),
  374.                 'district' => $district->getUriIdentity(),
  375.                 'page' => $this->getCurrentPageNumber()
  376.             ]),
  377.             'recommendationSpec' => $specs->recommendationSpec(),
  378.         ], response$response);
  379.     }
  380.     /**
  381.      * @Feature("extra_category_without_prepayment")
  382.      */
  383.     #[ParamConverter("city"converter"city_converter")]
  384.     #[Route("/api/profiles/listing/city/{city}/category/without_prepayment"name"api.profile_listing.category.without_prepayment"methods"GET"format"json")]
  385.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  386.     #[OA\Tag(name"ProfileListing")]
  387.     #[OA\Response(
  388.         response200,
  389.         description'',
  390.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  391.     )]
  392.     public function listWithoutPrepayment(Request $requestCity $city): Response
  393.     {
  394.         $listingData $this->profileListingDataCreator->getListingDataForFilter('listWithoutPrepayment', [], $city);
  395.         $specs $listingData['specs'];
  396.         $listingTypeName $listingData['listingTypeName'];
  397.         $response = new Response();
  398.         $result $this->paginatedListing($city'/city/{city}/category/without_prepayment', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  399.         if ($this->isApiRequest($request)) {
  400.             return $this->jsonListingResponse($result$city$specs);
  401.         }
  402.         $request->attributes->set('profiles_count'$result->totalCount());
  403.         $request->attributes->set('listingTypeName'$listingTypeName);
  404.         $request->attributes->set('city'$city);
  405.         return $this->render('ProfileList/list.html.twig', [
  406.             'profiles' => $result,
  407.             'source' => $this->source,
  408.             'source_default' => 'without_prepayment',
  409.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  410.                 'city' => $city->getUriIdentity(),
  411.                 'page' => $this->getCurrentPageNumber(),
  412.             ]),
  413.             'recommendationSpec' => $specs->recommendationSpec(),
  414.         ], response$response);
  415.     }
  416.     #[ParamConverter("city"converter"city_converter")]
  417.     #[Entity("station"expr"repository.ofUriIdentityWithinCity(station, city)")]
  418.     #[Route("/api/profiles/listing/city/{city}/station/{station}"name"api.profile_listing.by_station"methods"GET"format"json")]
  419.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  420.     #[OA\Tag(name"ProfileListing")]
  421.     #[OA\Response(
  422.         response200,
  423.         description'',
  424.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  425.     )]
  426.     public function listByStation(Request $requestCity $cityStation $station): Response
  427.     {
  428.         if (!$city->hasStation($station)) {
  429.             throw $this->createNotFoundException();
  430.         }
  431.         $specs $this->profileListSpecificationService->listByStation($station);
  432.         $response = new Response();
  433.         $result $this->paginatedListing($city'/city/{city}/station/{station}', ['city' => $city->getId(), 'station' => $station->getId()], $specs->spec(), nullnull$response);
  434.         if ($this->isApiRequest($request)) {
  435.             return $this->jsonListingResponse($result$city$specs);
  436.         }
  437.         return $this->render('ProfileList/list.html.twig', [
  438.             'profiles' => $result,
  439.             'source' => $this->source,
  440.             'source_default' => self::RESULT_SOURCE_STATION,
  441.             'station' => $station,
  442.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  443.                 'city' => $city->getUriIdentity(),
  444.                 'station' => $station->getUriIdentity(),
  445.                 'page' => $this->getCurrentPageNumber()
  446.             ]),
  447.             'recommendationSpec' => $specs->recommendationSpec(),
  448.         ], response$response);
  449.     }
  450.     #[ParamConverter("city"converter"city_converter")]
  451.     public function listByStations(City $citystring $stationsStationRepository $stationRepository): Response
  452.     {
  453.         $stationIds explode(','$stations);
  454.         $stations $stationRepository->findBy(['uriIdentity' => $stationIds]);
  455.         $specs $this->profileListSpecificationService->listByStations($stations);
  456.         $response = new Response();
  457.         $result $this->paginatedListing($citynull, [], $specs->spec(), nullnull$response);
  458.         return $this->render('ProfileList/list.html.twig', [
  459.             'profiles' => $result,
  460.             'recommendationSpec' => $specs->recommendationSpec(),
  461.         ]);
  462.     }
  463.     #[ParamConverter("city"converter"city_converter")]
  464.     #[Route("/api/profiles/listing/city/{city}/approved"name"api.profile_listing.approved"methods"GET"format"json")]
  465.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  466.     #[OA\Tag(name"ProfileListing")]
  467.     #[OA\Response(
  468.         response200,
  469.         description'',
  470.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  471.     )]
  472.     public function listApproved(Request $requestCity $city): Response
  473.     {
  474.         $specs $this->profileListSpecificationService->listApproved();
  475.         $response = new Response();
  476.         $result $this->paginatedListing($city'/city/{city}/approved', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  477.         if ($this->isApiRequest($request)) {
  478.             return $this->jsonListingResponse($result$city$specs);
  479.         }
  480.         return $this->render('ProfileList/list.html.twig', [
  481.             'profiles' => $result,
  482.             'source' => $this->source,
  483.             'source_default' => self::RESULT_SOURCE_APPROVED,
  484.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  485.                 'city' => $city->getUriIdentity(),
  486.                 'page' => $this->getCurrentPageNumber()
  487.             ]),
  488.             'recommendationSpec' => $specs->recommendationSpec(),
  489.         ], response$response);
  490.     }
  491.     /**
  492.      * @Feature("extra_category_with_whatsapp")
  493.      */
  494.     #[ParamConverter("city"converter"city_converter")]
  495.     #[Route("/api/profiles/listing/city/{city}/category/whatsapp"name"api.profile_listing.category.whatsapp"methods"GET"format"json")]
  496.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  497.     #[OA\Tag(name"ProfileListing")]
  498.     #[OA\Response(
  499.         response200,
  500.         description'',
  501.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  502.     )]
  503.     public function listWithWhatsapp(Request $requestCity $city): Response
  504.     {
  505.         $specs $this->profileListSpecificationService->listWithWhatsapp();
  506.         $response = new Response();
  507.         $result $this->paginatedListing($city'/city/{city}/category/whatsapp', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  508.         if ($this->isApiRequest($request)) {
  509.             return $this->jsonListingResponse($result$city$specs);
  510.         }
  511.         return $this->render('ProfileList/list.html.twig', [
  512.             'profiles' => $result,
  513.             'source' => $this->source,
  514.             'source_default' => self::RESULT_SOURCE_WITH_WHATSAPP,
  515.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  516.                 'city' => $city->getUriIdentity(),
  517.                 'page' => $this->getCurrentPageNumber(),
  518.             ]),
  519.             'recommendationSpec' => $specs->recommendationSpec(),
  520.         ], response$response);
  521.     }
  522.     /**
  523.      * @Feature("extra_category_with_telegram")
  524.      */
  525.     #[ParamConverter("city"converter"city_converter")]
  526.     #[Route("/api/profiles/listing/city/{city}/category/telegram"name"api.profile_listing.category.telegram"methods"GET"format"json")]
  527.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  528.     #[OA\Tag(name"ProfileListing")]
  529.     #[OA\Response(
  530.         response200,
  531.         description'',
  532.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  533.     )]
  534.     public function listWithTelegram(Request $requestCity $city): Response
  535.     {
  536.         $specs $this->profileListSpecificationService->listWithTelegram();
  537.         $response = new Response();
  538.         $result $this->paginatedListing($city'/city/{city}/category/telegram', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  539.         if ($this->isApiRequest($request)) {
  540.             return $this->jsonListingResponse($result$city$specs);
  541.         }
  542.         return $this->render('ProfileList/list.html.twig', [
  543.             'profiles' => $result,
  544.             'source' => $this->source,
  545.             'source_default' => self::RESULT_SOURCE_WITH_TELEGRAM,
  546.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  547.                 'city' => $city->getUriIdentity(),
  548.                 'page' => $this->getCurrentPageNumber(),
  549.             ]),
  550.             'recommendationSpec' => $specs->recommendationSpec(),
  551.         ], response$response);
  552.     }
  553.     /**
  554.      * @Feature("extra_category_eighteen_years_old")
  555.      */
  556.     #[ParamConverter("city"converter"city_converter")]
  557.     #[Route("/api/profiles/listing/city/{city}/category/eighteen_years_old"name"api.profile_listing.category.eighteen_years_old"methods"GET"format"json")]
  558.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  559.     #[OA\Tag(name"ProfileListing")]
  560.     #[OA\Response(
  561.         response200,
  562.         description'',
  563.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  564.     )]
  565.     public function listEighteenYearsOld(Request $requestCity $city): Response
  566.     {
  567.         $specs $this->profileListSpecificationService->listEighteenYearsOld();
  568.         $response = new Response();
  569.         $result $this->paginatedListing($city'/city/{city}/category/eighteen_years_old', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  570.         if ($this->isApiRequest($request)) {
  571.             return $this->jsonListingResponse($result$city$specs);
  572.         }
  573.         return $this->render('ProfileList/list.html.twig', [
  574.             'profiles' => $result,
  575.             'source' => $this->source,
  576.             'source_default' => self::RESULT_SOURCE_EIGHTEEN_YEARS_OLD,
  577.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  578.                 'city' => $city->getUriIdentity(),
  579.                 'page' => $this->getCurrentPageNumber(),
  580.             ]),
  581.             'recommendationSpec' => $specs->recommendationSpec(),
  582.         ], response$response);
  583.     }
  584.     /**
  585.      * @Feature("extra_category_rublevskie")
  586.      */
  587.     #[ParamConverter("city"converter"city_converter")]
  588.     #[Route("/api/profiles/listing/city/{city}/category/rublevskie"name"api.profile_listing.category.rublevskie"methods"GET"format"json")]
  589.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  590.     #[OA\Tag(name"ProfileListing")]
  591.     #[OA\Response(
  592.         response200,
  593.         description'',
  594.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  595.     )]
  596.     public function listRublevskie(Request $requestCity $city): Response
  597.     {
  598.         if ($city->getUriIdentity() !== 'moscow') {
  599.             throw $this->createNotFoundException();
  600.         }
  601.         $specs $this->profileListSpecificationService->listRublevskie($city);
  602.         $response = new Response();
  603.         $result $this->paginatedListing($city'/city/{city}/category/rublevskie', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  604.         if ($this->isApiRequest($request)) {
  605.             return $this->jsonListingResponse($result$city$specs);
  606.         }
  607.         return $this->render('ProfileList/list.html.twig', [
  608.             'profiles' => $result,
  609.             'source' => $this->source,
  610.             'source_default' => 'rublevskie',
  611.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  612.                 'city' => $city->getUriIdentity(),
  613.                 'page' => $this->getCurrentPageNumber(),
  614.             ]),
  615.             'recommendationSpec' => $specs->recommendationSpec(),
  616.         ], response$response);
  617.     }
  618.     /**
  619.      * @Feature("extra_category_with_tattoo")
  620.      */
  621.     #[ParamConverter("city"converter"city_converter")]
  622.     #[Route("/api/profiles/listing/city/{city}/category/with_tattoo"name"api.profile_listing.category.with_tattoo"methods"GET"format"json")]
  623.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  624.     #[OA\Tag(name"ProfileListing")]
  625.     #[OA\Response(
  626.         response200,
  627.         description'',
  628.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  629.     )]
  630.     public function listWithTattoo(Request $requestCity $city): Response
  631.     {
  632.         $specs $this->profileListSpecificationService->listWithTattoo();
  633.         $response = new Response();
  634.         $result $this->paginatedListing($city'/city/{city}/category/with_tattoo', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  635.         if ($this->isApiRequest($request)) {
  636.             return $this->jsonListingResponse($result$city$specs);
  637.         }
  638.         return $this->render('ProfileList/list.html.twig', [
  639.             'profiles' => $result,
  640.             'source' => $this->source,
  641.             'source_default' => self::RESULT_SOURCE_WITH_TATTOO,
  642.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  643.                 'city' => $city->getUriIdentity(),
  644.                 'page' => $this->getCurrentPageNumber(),
  645.             ]),
  646.             'recommendationSpec' => $specs->recommendationSpec(),
  647.         ], response$response);
  648.     }
  649.     #[ParamConverter("city"converter"city_converter")]
  650.     #[Route("/api/profiles/listing/city/{city}/with_comments"name"api.profile_listing.with_comments"methods"GET"format"json")]
  651.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  652.     #[OA\Tag(name"ProfileListing")]
  653.     #[OA\Response(
  654.         response200,
  655.         description'',
  656.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  657.     )]
  658.     public function listWithComments(Request $requestCity $city): Response
  659.     {
  660.         $specs $this->profileListSpecificationService->listWithComments();
  661.         $response = new Response();
  662.         $result $this->paginatedListing($city'/city/{city}/with_comments', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  663.         if ($this->isApiRequest($request)) {
  664.             return $this->jsonListingResponse($result$city$specs);
  665.         }
  666.         return $this->render('ProfileList/list.html.twig', [
  667.             'profiles' => $result,
  668.             'source' => $this->source,
  669.             'source_default' => self::RESULT_SOURCE_WITH_COMMENTS,
  670.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  671.                 'city' => $city->getUriIdentity(),
  672.                 'page' => $this->getCurrentPageNumber()
  673.             ]),
  674.             'recommendationSpec' => $specs->recommendationSpec(),
  675.         ], response$response);
  676.     }
  677.     /**
  678.      * @Feature("extra_category_with_piercing")
  679.      */
  680.     #[ParamConverter("city"converter"city_converter")]
  681.     #[Route("/api/profiles/listing/city/{city}/category/with_piercing"name"api.profile_listing.category.with_piercing"methods"GET"format"json")]
  682.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  683.     #[OA\Tag(name"ProfileListing")]
  684.     #[OA\Response(
  685.         response200,
  686.         description'',
  687.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  688.     )]
  689.     public function listWithPiercing(Request $requestCity $city): Response
  690.     {
  691.         $specs $this->profileListSpecificationService->listWithPiercing();
  692.         $response = new Response();
  693.         $result $this->paginatedListing($city'/city/{city}/category/with_piercing', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  694.         if ($this->isApiRequest($request)) {
  695.             return $this->jsonListingResponse($result$city$specs);
  696.         }
  697.         return $this->render('ProfileList/list.html.twig', [
  698.             'profiles' => $result,
  699.             'source' => $this->source,
  700.             'source_default' => self::RESULT_SOURCE_WITH_PIERCING,
  701.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  702.                 'city' => $city->getUriIdentity(),
  703.                 'page' => $this->getCurrentPageNumber(),
  704.             ]),
  705.             'recommendationSpec' => $specs->recommendationSpec(),
  706.         ], response$response);
  707.     }
  708.     #[ParamConverter("city"converter"city_converter")]
  709.     #[Route("/api/profiles/listing/city/{city}/with_video"name"api.profile_listing.with_video"methods"GET"format"json")]
  710.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  711.     #[OA\Tag(name"ProfileListing")]
  712.     #[OA\Response(
  713.         response200,
  714.         description'',
  715.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  716.     )]
  717.     public function listWithVideo(Request $requestCity $city): Response
  718.     {
  719.         $specs $this->profileListSpecificationService->listWithVideo();
  720.         $response = new Response();
  721.         $result $this->paginatedListing($city'/city/{city}/with_video', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  722.         if ($this->isApiRequest($request)) {
  723.             return $this->jsonListingResponse($result$city$specs);
  724.         }
  725.         return $this->render('ProfileList/list.html.twig', [
  726.             'profiles' => $result,
  727.             'source' => $this->source,
  728.             'source_default' => self::RESULT_SOURCE_WITH_VIDEO,
  729.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  730.                 'city' => $city->getUriIdentity(),
  731.                 'page' => $this->getCurrentPageNumber()
  732.             ]),
  733.             'recommendationSpec' => $specs->recommendationSpec(),
  734.         ], response$response);
  735.     }
  736.      /**
  737.      * @Feature("extra_category_round_the_clock")
  738.      */
  739.     #[ParamConverter("city"converter"city_converter")]
  740.     #[Route("/api/profiles/listing/city/{city}/category/round_the_clock"name"api.profile_listing.category.round_the_clock"methods"GET"format"json")]
  741.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  742.     #[OA\Tag(name"ProfileListing")]
  743.     #[OA\Response(
  744.         response200,
  745.         description'',
  746.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  747.     )]
  748.     public function listRoundTheClock(Request $requestCity $city): Response
  749.     {
  750.         $specs $this->profileListSpecificationService->listRoundTheClock();
  751.         $response = new Response();
  752.         $result $this->paginatedListing($city'/city/{city}/category/round_the_clock', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  753.         if ($this->isApiRequest($request)) {
  754.             return $this->jsonListingResponse($result$city$specs);
  755.         }
  756.         return $this->render('ProfileList/list.html.twig', [
  757.             'profiles' => $result,
  758.             'source' => $this->source,
  759.             'source_default' => self::RESULT_SOURCE_ROUND_THE_CLOCK,
  760.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  761.                 'city' => $city->getUriIdentity(),
  762.                 'page' => $this->getCurrentPageNumber(),
  763.             ]),
  764.             'recommendationSpec' => $specs->recommendationSpec(),
  765.         ], response$response);
  766.     }
  767.     /**
  768.      * @Feature("extra_category_for_two_hours")
  769.      */
  770.     #[ParamConverter("city"converter"city_converter")]
  771.     #[Route("/api/profiles/listing/city/{city}/category/for_two_hours"name"api.profile_listing.category.for_two_hours"methods"GET"format"json")]
  772.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  773.     #[OA\Tag(name"ProfileListing")]
  774.     #[OA\Response(
  775.         response200,
  776.         description'',
  777.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  778.     )]
  779.     public function listForTwoHours(Request $requestCity $city): Response
  780.     {
  781.         $specs $this->profileListSpecificationService->listForTwoHours();
  782.         $response = new Response();
  783.         $result $this->paginatedListing($city'/city/{city}/category/for_two_hours', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  784.         if ($this->isApiRequest($request)) {
  785.             return $this->jsonListingResponse($result$city$specs);
  786.         }
  787.         return $this->render('ProfileList/list.html.twig', [
  788.             'profiles' => $result,
  789.             'source' => $this->source,
  790.             'source_default' => self::RESULT_SOURCE_FOR_TWO_HOURS,
  791.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  792.                 'city' => $city->getUriIdentity(),
  793.                 'page' => $this->getCurrentPageNumber(),
  794.             ]),
  795.             'recommendationSpec' => $specs->recommendationSpec(),
  796.         ], response$response);
  797.     }
  798.     /**
  799.      * @Feature("extra_category_for_hour")
  800.      */
  801.     #[ParamConverter("city"converter"city_converter")]
  802.     #[Route("/api/profiles/listing/city/{city}/category/for_hour"name"api.profile_listing.category.for_hour"methods"GET"format"json")]
  803.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  804.     #[OA\Tag(name"ProfileListing")]
  805.     #[OA\Response(
  806.         response200,
  807.         description'',
  808.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  809.     )]
  810.     public function listForHour(Request $requestCity $city): Response
  811.     {
  812.         $specs $this->profileListSpecificationService->listForHour();
  813.         $response = new Response();
  814.         $result $this->paginatedListing($city'/city/{city}/category/for_hour', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  815.         if ($this->isApiRequest($request)) {
  816.             return $this->jsonListingResponse($result$city$specs);
  817.         }
  818.         return $this->render('ProfileList/list.html.twig', [
  819.             'profiles' => $result,
  820.             'source' => $this->source,
  821.             'source_default' => self::RESULT_SOURCE_FOR_HOUR,
  822.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  823.                 'city' => $city->getUriIdentity(),
  824.                 'page' => $this->getCurrentPageNumber(),
  825.             ]),
  826.             'recommendationSpec' => $specs->recommendationSpec(),
  827.         ], response$response);
  828.     }
  829.     /**
  830.      * @Feature("extra_category_express_program")
  831.      */
  832.     #[ParamConverter("city"converter"city_converter")]
  833.     #[Route("/api/profiles/listing/city/{city}/category/express"name"api.profile_listing.category.express"methods"GET"format"json")]
  834.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  835.     #[OA\Tag(name"ProfileListing")]
  836.     #[OA\Response(
  837.         response200,
  838.         description'',
  839.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  840.     )]
  841.     public function listExpress(Request $requestCity $city): Response
  842.     {
  843.         $specs $this->profileListSpecificationService->listExpress();
  844.         $response = new Response();
  845.         $result $this->paginatedListing($city'/city/{city}/category/express', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  846.         if ($this->isApiRequest($request)) {
  847.             return $this->jsonListingResponse($result$city$specs);
  848.         }
  849.         return $this->render('ProfileList/list.html.twig', [
  850.             'profiles' => $result,
  851.             'source' => $this->source,
  852.             'source_default' => self::RESULT_SOURCE_EXPRESS_PROGRAM,
  853.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  854.                 'city' => $city->getUriIdentity(),
  855.                 'page' => $this->getCurrentPageNumber(),
  856.             ]),
  857.             'recommendationSpec' => $specs->recommendationSpec(),
  858.         ], response$response);
  859.     }
  860.     /**
  861.      * @Feature("extra_category_grandmothers")
  862.      */
  863.     #[ParamConverter("city"converter"city_converter")]
  864.     #[Route("/api/profiles/listing/city/{city}/category/grandmothers"name"api.profile_listing.category.grandmothers"methods"GET"format"json")]
  865.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  866.     #[OA\Tag(name"ProfileListing")]
  867.     #[OA\Response(
  868.         response200,
  869.         description'',
  870.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  871.     )]
  872.     public function listGrandmothers(Request $requestCity $city): Response
  873.     {
  874.         $specs $this->profileListSpecificationService->listGrandmothers();
  875.         $response = new Response();
  876.         $result $this->paginatedListing($city'/city/{city}/category/grandmothers', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  877.         if ($this->isApiRequest($request)) {
  878.             return $this->jsonListingResponse($result$city$specs);
  879.         }
  880.         return $this->render('ProfileList/list.html.twig', [
  881.             'profiles' => $result,
  882.             'source' => $this->source,
  883.             'source_default' => 'grandmothers',
  884.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  885.                 'city' => $city->getUriIdentity(),
  886.                 'page' => $this->getCurrentPageNumber(),
  887.             ]),
  888.             'recommendationSpec' => $specs->recommendationSpec(),
  889.         ], response$response);
  890.     }
  891.         /**
  892.      * @Feature("extra_category_big_breast")
  893.      */
  894.     #[ParamConverter("city"converter"city_converter")]
  895.     #[Route("/api/profiles/listing/city/{city}/category/big_breast"name"api.profile_listing.category.big_breast"methods"GET"format"json")]
  896.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  897.     #[OA\Tag(name"ProfileListing")]
  898.     #[OA\Response(
  899.         response200,
  900.         description'',
  901.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  902.     )]
  903.     public function listBigBreast(Request $requestCity $city): Response
  904.     {
  905.         $specs $this->profileListSpecificationService->listBigBreast();
  906.         $response = new Response();
  907.         $result $this->paginatedListing($city'/city/{city}/category/big_breast', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  908.         if ($this->isApiRequest($request)) {
  909.             return $this->jsonListingResponse($result$city$specs);
  910.         }
  911.         return $this->render('ProfileList/list.html.twig', [
  912.             'profiles' => $result,
  913.             'source' => $this->source,
  914.             'source_default' => 'big_breast',
  915.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  916.                 'city' => $city->getUriIdentity(),
  917.                 'page' => $this->getCurrentPageNumber(),
  918.             ]),
  919.             'recommendationSpec' => $specs->recommendationSpec(),
  920.         ], response$response);
  921.     }
  922.     /**
  923.      * @Feature("extra_category_very_skinny")
  924.      */
  925.     #[ParamConverter("city"converter"city_converter")]
  926.     #[Route("/api/profiles/listing/city/{city}/category/very_skinny"name"api.profile_listing.category.very_skinny"methods"GET"format"json")]
  927.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  928.     #[OA\Tag(name"ProfileListing")]
  929.     #[OA\Response(
  930.         response200,
  931.         description'',
  932.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  933.     )]
  934.     public function listVerySkinny(Request $requestCity $city): Response
  935.     {
  936.         $specs $this->profileListSpecificationService->listVerySkinny();
  937.         $response = new Response();
  938.         $result $this->paginatedListing($city'/city/{city}/category/very_skinny', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  939.         if ($this->isApiRequest($request)) {
  940.             return $this->jsonListingResponse($result$city$specs);
  941.         }
  942.         return $this->render('ProfileList/list.html.twig', [
  943.             'profiles' => $result,
  944.             'source' => $this->source,
  945.             'source_default' => 'very_skinny',
  946.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  947.                 'city' => $city->getUriIdentity(),
  948.                 'page' => $this->getCurrentPageNumber(),
  949.             ]),
  950.             'recommendationSpec' => $specs->recommendationSpec(),
  951.         ], response$response);
  952.     }
  953.     /**
  954.      * @Feature("extra_category_small_ass")
  955.      */
  956.     #[ParamConverter("city"converter"city_converter")]
  957.     #[Route("/api/profiles/listing/city/{city}/category/small_ass"name"api.profile_listing.category.small_ass"methods"GET"format"json")]
  958.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  959.     #[OA\Tag(name"ProfileListing")]
  960.     #[OA\Response(
  961.         response200,
  962.         description'',
  963.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  964.     )]
  965.     public function listSmallAss(Request $requestCity $city): Response
  966.     {
  967.         $specs $this->profileListSpecificationService->listSmallAss();
  968.         $response = new Response();
  969.         $result $this->paginatedListing($city'/city/{city}/category/small_ass', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  970.         if ($this->isApiRequest($request)) {
  971.             return $this->jsonListingResponse($result$city$specs);
  972.         }
  973.         return $this->render('ProfileList/list.html.twig', [
  974.             'profiles' => $result,
  975.             'source' => $this->source,
  976.             'source_default' => 'small_ass',
  977.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  978.                 'city' => $city->getUriIdentity(),
  979.                 'page' => $this->getCurrentPageNumber(),
  980.             ]),
  981.             'recommendationSpec' => $specs->recommendationSpec(),
  982.         ], response$response);
  983.     }
  984.     /**
  985.      * @Feature("extra_category_beautiful_prostitutes")
  986.      */
  987.     #[ParamConverter("city"converter"city_converter")]
  988.     #[Route("/api/profiles/listing/city/{city}/category/beautiful_prostitutes"name"api.profile_listing.category.beautiful_prostitutes"methods"GET"format"json")]
  989.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  990.     #[OA\Tag(name"ProfileListing")]
  991.     #[OA\Response(
  992.         response200,
  993.         description'',
  994.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  995.     )]
  996.     public function listBeautifulProstitutes(Request $requestCity $city): Response
  997.     {
  998.         $specs $this->profileListSpecificationService->listBeautifulProstitutes();
  999.         $response = new Response();
  1000.         $result $this->paginatedListing($city'/city/{city}/category/beautiful_prostitutes', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  1001.         if ($this->isApiRequest($request)) {
  1002.             return $this->jsonListingResponse($result$city$specs);
  1003.         }
  1004.         return $this->render('ProfileList/list.html.twig', [
  1005.             'profiles' => $result,
  1006.             'source' => $this->source,
  1007.             'source_default' => 'beautiful_prostitutes',
  1008.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1009.                 'city' => $city->getUriIdentity(),
  1010.                 'page' => $this->getCurrentPageNumber(),
  1011.             ]),
  1012.             'recommendationSpec' => $specs->recommendationSpec(),
  1013.         ], response$response);
  1014.     }
  1015.     /**
  1016.      * @Feature("extra_category_without_intermediaries")
  1017.      */
  1018.     #[ParamConverter("city"converter"city_converter")]
  1019.     #[Route("/api/profiles/listing/city/{city}/category/without_intermediaries"name"api.profile_listing.category.without_intermediaries"methods"GET"format"json")]
  1020.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1021.     #[OA\Tag(name"ProfileListing")]
  1022.     #[OA\Response(
  1023.         response200,
  1024.         description'',
  1025.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1026.     )]
  1027.     public function listWithoutIntermediaries(Request $requestCity $city): Response
  1028.     {
  1029.         $specs $this->profileListSpecificationService->listWithoutIntermediaries();
  1030.         $response = new Response();
  1031.         $result $this->paginatedListing($city'/city/{city}/category/without_intermediaries', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  1032.         if ($this->isApiRequest($request)) {
  1033.             return $this->jsonListingResponse($result$city$specs);
  1034.         }
  1035.         return $this->render('ProfileList/list.html.twig', [
  1036.             'profiles' => $result,
  1037.             'source' => $this->source,
  1038.             'source_default' => 'without_intermediaries',
  1039.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1040.                 'city' => $city->getUriIdentity(),
  1041.                 'page' => $this->getCurrentPageNumber(),
  1042.             ]),
  1043.             'recommendationSpec' => $specs->recommendationSpec(),
  1044.         ], response$response);
  1045.     }
  1046.     /**
  1047.      * @Feature("extra_category_intim_services")
  1048.      */
  1049.     #[ParamConverter("city"converter"city_converter")]
  1050.     public function intimServices(Request $requestCity $city): Response
  1051.     {
  1052.         $servicesByGroup $this->serviceRepository->allIndexedByGroup();
  1053.         return $this->render('ProfileList/intim_services.html.twig', [
  1054.             'city' => $city,
  1055.             'servicesByGroup' => $servicesByGroup,
  1056.             'skipSetCurrentListingPage' => true,
  1057.         ]);
  1058.     }
  1059.     /**
  1060.      * @Feature("extra_category_outcall")
  1061.      */
  1062.     #[ParamConverter("city"converter"city_converter")]
  1063.     #[Route("/api/profiles/listing/city/{city}/category/outcall"name"api.profile_listing.category.outcall"methods"GET"format"json")]
  1064.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1065.     #[OA\Tag(name"ProfileListing")]
  1066.     #[OA\Response(
  1067.         response200,
  1068.         description'',
  1069.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1070.     )]
  1071.     public function listOutcall(Request $requestCity $city): Response
  1072.     {
  1073.         $specs $this->profileListSpecificationService->listByOutcall();
  1074.         $response = new Response();
  1075.         $result $this->paginatedListing($city'/city/{city}/category/outcall', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  1076.         if ($this->isApiRequest($request)) {
  1077.             return $this->jsonListingResponse($result$city$specs);
  1078.         }
  1079.         return $this->render('ProfileList/list.html.twig', [
  1080.             'profiles' => $result,
  1081.             'source' => $this->source,
  1082.             'source_default' => 'outcall',
  1083.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1084.                 'city' => $city->getUriIdentity(),
  1085.                 'page' => $this->getCurrentPageNumber(),
  1086.             ]),
  1087.             'recommendationSpec' => $specs->recommendationSpec(),
  1088.         ], response$response);
  1089.     }
  1090.     /**
  1091.      * @Feature("extra_category_dwarfs")
  1092.      */
  1093.     #[ParamConverter("city"converter"city_converter")]
  1094.     #[Route("/api/profiles/listing/city/{city}/category/dwarfs"name"api.profile_listing.category.dwarfs"methods"GET"format"json")]
  1095.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1096.     #[OA\Tag(name"ProfileListing")]
  1097.     #[OA\Response(
  1098.         response200,
  1099.         description'',
  1100.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1101.     )]
  1102.     public function listDwarfs(Request $requestCity $city): Response
  1103.     {
  1104.         $specs $this->profileListSpecificationService->listDwarfs();
  1105.         $response = new Response();
  1106.         $result $this->paginatedListing($city'/city/{city}/category/dwarfs', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  1107.         if ($this->isApiRequest($request)) {
  1108.             return $this->jsonListingResponse($result$city$specs);
  1109.         }
  1110.         return $this->render('ProfileList/list.html.twig', [
  1111.             'profiles' => $result,
  1112.             'source' => $this->source,
  1113.             'source_default' => 'dwarfs',
  1114.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1115.                 'city' => $city->getUriIdentity(),
  1116.                 'page' => $this->getCurrentPageNumber(),
  1117.             ]),
  1118.             'recommendationSpec' => $specs->recommendationSpec(),
  1119.         ], response$response);
  1120.     }
  1121.     #[ParamConverter("city"converter"city_converter")]
  1122.     #[Route("/api/profiles/listing/city/{city}/with_selfie"name"api.profile_listing.with_selfie"methods"GET"format"json")]
  1123.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1124.     #[OA\Tag(name"ProfileListing")]
  1125.     #[OA\Response(
  1126.         response200,
  1127.         description'',
  1128.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1129.     )]
  1130.     public function listWithSelfie(Request $requestCity $city): Response
  1131.     {
  1132.         $specs $this->profileListSpecificationService->listWithSelfie();
  1133.         $response = new Response();
  1134.         $result $this->paginatedListing($city'/city/{city}/with_selfie', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  1135.         if ($this->isApiRequest($request)) {
  1136.             return $this->jsonListingResponse($result$city$specs);
  1137.         }
  1138.         return $this->render('ProfileList/list.html.twig', [
  1139.             'profiles' => $result,
  1140.             'source' => $this->source,
  1141.             'source_default' => self::RESULT_SOURCE_WITH_SELFIE,
  1142.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1143.                 'city' => $city->getUriIdentity(),
  1144.                 'page' => $this->getCurrentPageNumber()
  1145.             ]),
  1146.             'recommendationSpec' => $specs->recommendationSpec(),
  1147.         ], response$response);
  1148.     }
  1149.     /**
  1150.      * @Feature("extra_category_top_100")
  1151.      */
  1152.     #[ParamConverter("city"converter"city_converter")]
  1153.     #[Route("/api/profiles/listing/city/{city}/category/top_100"name"api.profile_listing.category.top_100"methods"GET"format"json")]
  1154.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1155.     #[OA\Tag(name"ProfileListing")]
  1156.     #[OA\Response(
  1157.         response200,
  1158.         description'',
  1159.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1160.     )]
  1161.     public function listTop100(Request $requestCity $city): Response
  1162.     {
  1163.         $specs $this->profileListSpecificationService->listApproved();
  1164.         $result $this->top100ProfilesService->getSortedProfilesByVisits($city);
  1165.         if ($this->isApiRequest($request)) {
  1166.             return $this->jsonListingResponse($result$city$specs);
  1167.         }
  1168.         return $this->render('ProfileList/list.html.twig', [
  1169.             'profiles' => $result,
  1170.             'source' => self::RESULT_SOURCE_TOP_100,
  1171.             'source_default' => self::RESULT_SOURCE_TOP_100,
  1172.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1173.                 'city' => $city->getUriIdentity(),
  1174.                 'page' => $this->getCurrentPageNumber(),
  1175.             ]),
  1176.             'recommendationSpec' => $specs->recommendationSpec(),
  1177.         ]);
  1178.     }
  1179.     /**
  1180.      * @Feature("extra_category_eromassage")
  1181.      */
  1182.     #[ParamConverter("city"converter"city_converter")]
  1183.     #[Entity("county"expr"repository.ofUriIdentityWithinCity(county, city)")]
  1184.     public function listByCountyEromassage(Request $requestCity $cityCounty $county): Response
  1185.     {
  1186.         if (!$city->hasCounty($county)) {
  1187.             throw $this->createNotFoundException();
  1188.         }
  1189.         $specs $this->profileListSpecificationService->listByCountyEromassage($county);
  1190.         $response = new Response();
  1191.         $result $this->paginatedListing(
  1192.             $city,
  1193.             '/city/{city}/county/{county}/eromassage',
  1194.             ['city' => $city->getId(), 'county' => $county->getId()],
  1195.             $specs->spec(),
  1196.             null,
  1197.             null,
  1198.             $response
  1199.         );
  1200.         $request->attributes->set('profiles_count'$result->totalCount());
  1201.         return $this->render('ProfileList/list.html.twig', [
  1202.             'profiles' => $result,
  1203.             'source' => $this->source,
  1204.             'source_default' => self::RESULT_SOURCE_EROMASSAGE,
  1205.             'county' => $county,
  1206.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1207.                 'city' => $city->getUriIdentity(),
  1208.                 'county' => $county->getUriIdentity(),
  1209.                 'page' => $this->getCurrentPageNumber(),
  1210.             ]),
  1211.             'recommendationSpec' => $specs->recommendationSpec(),
  1212.         ], response$response);
  1213.     }
  1214.     /**
  1215.      * @Feature("extra_category_eromassage")
  1216.      */
  1217.     #[ParamConverter("city"converter"city_converter")]
  1218.     #[Entity("district"expr"repository.ofUriIdentityWithinCity(district, city)")]
  1219.     public function listByDistrictEromassage(Request $requestCity $cityDistrict $district): Response
  1220.     {
  1221.         if (!$city->hasDistrict($district)) {
  1222.             throw $this->createNotFoundException();
  1223.         }
  1224.         $specs $this->profileListSpecificationService->listByDistrictEromassage($district);
  1225.         $response = new Response();
  1226.         $result $this->paginatedListing(
  1227.             $city,
  1228.             '/city/{city}/district/{district}/eromassage',
  1229.             ['city' => $city->getId(), 'district' => $district->getId()],
  1230.             $specs->spec(),
  1231.             null,
  1232.             null,
  1233.             $response
  1234.         );
  1235.         $request->attributes->set('profiles_count'$result->totalCount());
  1236.         return $this->render('ProfileList/list.html.twig', [
  1237.             'profiles' => $result,
  1238.             'source' => $this->source,
  1239.             'source_default' => self::RESULT_SOURCE_EROMASSAGE,
  1240.             'district' => $district,
  1241.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1242.                 'city' => $city->getUriIdentity(),
  1243.                 'district' => $district->getUriIdentity(),
  1244.                 'page' => $this->getCurrentPageNumber(),
  1245.             ]),
  1246.             'recommendationSpec' => $specs->recommendationSpec(),
  1247.         ], response$response);
  1248.     }
  1249.     /**
  1250.      * @Feature("extra_category_eromassage")
  1251.      */
  1252.     #[ParamConverter("city"converter"city_converter")]
  1253.     #[Entity("station"expr"repository.ofUriIdentityWithinCity(station, city)")]
  1254.     public function listByStationEromassage(Request $requestCity $cityStation $station): Response
  1255.     {
  1256.         if (!$city->hasStation($station)) {
  1257.             throw $this->createNotFoundException();
  1258.         }
  1259.         $specs $this->profileListSpecificationService->listByStationEromassage($station);
  1260.         $response = new Response();
  1261.         $result $this->paginatedListing(
  1262.             $city,
  1263.             '/city/{city}/station/{station}/eromassage',
  1264.             ['city' => $city->getId(), 'station' => $station->getId()],
  1265.             $specs->spec(),
  1266.             null,
  1267.             null,
  1268.             $response
  1269.         );
  1270.         $request->attributes->set('profiles_count'$result->totalCount());
  1271.         return $this->render('ProfileList/list.html.twig', [
  1272.             'profiles' => $result,
  1273.             'source' => $this->source,
  1274.             'source_default' => self::RESULT_SOURCE_EROMASSAGE,
  1275.             'station' => $station,
  1276.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1277.                 'city' => $city->getUriIdentity(),
  1278.                 'station' => $station->getUriIdentity(),
  1279.                 'page' => $this->getCurrentPageNumber(),
  1280.             ]),
  1281.             'recommendationSpec' => $specs->recommendationSpec(),
  1282.         ], response$response);
  1283.     }
  1284.     /**
  1285.      * @Feature("extra_category_verified")
  1286.      */
  1287.     #[ParamConverter("city"converter"city_converter")]
  1288.     #[Entity("county"expr"repository.ofUriIdentityWithinCity(county, city)")]
  1289.     public function listByCountyVerified(Request $requestCity $cityCounty $county): Response
  1290.     {
  1291.         if (!$city->hasCounty($county)) {
  1292.             throw $this->createNotFoundException();
  1293.         }
  1294.         $specs $this->profileListSpecificationService->listByCountyVerified($county);
  1295.         $response = new Response();
  1296.         $result $this->paginatedListing(
  1297.             $city,
  1298.             '/city/{city}/county/{county}/proverennye',
  1299.             ['city' => $city->getId(), 'county' => $county->getId()],
  1300.             $specs->spec(),
  1301.             null,
  1302.             null,
  1303.             $response
  1304.         );
  1305.         $request->attributes->set('profiles_count'$result->totalCount());
  1306.         return $this->render('ProfileList/list.html.twig', [
  1307.             'profiles' => $result,
  1308.             'source' => $this->source,
  1309.             'source_default' => self::RESULT_SOURCE_VERIFIED,
  1310.             'county' => $county,
  1311.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1312.                 'city' => $city->getUriIdentity(),
  1313.                 'county' => $county->getUriIdentity(),
  1314.                 'page' => $this->getCurrentPageNumber(),
  1315.             ]),
  1316.             'recommendationSpec' => $specs->recommendationSpec(),
  1317.         ], response$response);
  1318.     }
  1319.     /**
  1320.      * @Feature("extra_category_verified")
  1321.      */
  1322.     #[ParamConverter("city"converter"city_converter")]
  1323.     #[Entity("district"expr"repository.ofUriIdentityWithinCity(district, city)")]
  1324.     public function listByDistrictVerified(Request $requestCity $cityDistrict $district): Response
  1325.     {
  1326.         if (!$city->hasDistrict($district)) {
  1327.             throw $this->createNotFoundException();
  1328.         }
  1329.         $specs $this->profileListSpecificationService->listByDistrictVerified($district);
  1330.         $response = new Response();
  1331.         $result $this->paginatedListing(
  1332.             $city,
  1333.             '/city/{city}/district/{district}/proverennye',
  1334.             ['city' => $city->getId(), 'district' => $district->getId()],
  1335.             $specs->spec(),
  1336.             null,
  1337.             null,
  1338.             $response
  1339.         );
  1340.         $request->attributes->set('profiles_count'$result->totalCount());
  1341.         return $this->render('ProfileList/list.html.twig', [
  1342.             'profiles' => $result,
  1343.             'source' => $this->source,
  1344.             'source_default' => self::RESULT_SOURCE_VERIFIED,
  1345.             'district' => $district,
  1346.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1347.                 'city' => $city->getUriIdentity(),
  1348.                 'district' => $district->getUriIdentity(),
  1349.                 'page' => $this->getCurrentPageNumber(),
  1350.             ]),
  1351.             'recommendationSpec' => $specs->recommendationSpec(),
  1352.         ], response$response);
  1353.     }
  1354.     /**
  1355.      * @Feature("extra_category_verified")
  1356.      */
  1357.     #[ParamConverter("city"converter"city_converter")]
  1358.     #[Entity("station"expr"repository.ofUriIdentityWithinCity(station, city)")]
  1359.     public function listByStationVerified(Request $requestCity $cityStation $station): Response
  1360.     {
  1361.         if (!$city->hasStation($station)) {
  1362.             throw $this->createNotFoundException();
  1363.         }
  1364.         $specs $this->profileListSpecificationService->listByStationVerified($station);
  1365.         $response = new Response();
  1366.         $result $this->paginatedListing(
  1367.             $city,
  1368.             '/city/{city}/station/{station}/proverennye',
  1369.             ['city' => $city->getId(), 'station' => $station->getId()],
  1370.             $specs->spec(),
  1371.             null,
  1372.             null,
  1373.             $response
  1374.         );
  1375.         $request->attributes->set('profiles_count'$result->totalCount());
  1376.         return $this->render('ProfileList/list.html.twig', [
  1377.             'profiles' => $result,
  1378.             'source' => $this->source,
  1379.             'source_default' => self::RESULT_SOURCE_VERIFIED,
  1380.             'station' => $station,
  1381.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1382.                 'city' => $city->getUriIdentity(),
  1383.                 'station' => $station->getUriIdentity(),
  1384.                 'page' => $this->getCurrentPageNumber(),
  1385.             ]),
  1386.             'recommendationSpec' => $specs->recommendationSpec(),
  1387.         ], response$response);
  1388.     }
  1389.     /**
  1390.      * @Feature("extra_category_cheap")
  1391.      */
  1392.     #[ParamConverter("city"converter"city_converter")]
  1393.     #[Entity("county"expr"repository.ofUriIdentityWithinCity(county, city)")]
  1394.     public function listByCountyCheap(Request $requestCity $cityCounty $county): Response
  1395.     {
  1396.         if (!$city->hasCounty($county)) {
  1397.             throw $this->createNotFoundException();
  1398.         }
  1399.         $specs $this->profileListSpecificationService->listByCountyCheap($county);
  1400.         $response = new Response();
  1401.         $result $this->paginatedListing(
  1402.             $city,
  1403.             null,
  1404.             [],
  1405.             $specs->spec(),
  1406.             null,
  1407.             null,
  1408.             $response
  1409.         );
  1410.         $request->attributes->set('profiles_count'$result->totalCount());
  1411.         return $this->render('ProfileList/list.html.twig', [
  1412.             'profiles' => $result,
  1413.             'source' => $this->source,
  1414.             'source_default' => self::RESULT_SOURCE_CHEAP,
  1415.             'county' => $county,
  1416.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1417.                 'city' => $city->getUriIdentity(),
  1418.                 'county' => $county->getUriIdentity(),
  1419.                 'page' => $this->getCurrentPageNumber(),
  1420.             ]),
  1421.             'recommendationSpec' => $specs->recommendationSpec(),
  1422.         ], response$response);
  1423.     }
  1424.     /**
  1425.      * @Feature("extra_category_cheap")
  1426.      */
  1427.     #[ParamConverter("city"converter"city_converter")]
  1428.     #[Entity("district"expr"repository.ofUriIdentityWithinCity(district, city)")]
  1429.     public function listByDistrictCheap(Request $requestCity $cityDistrict $district): Response
  1430.     {
  1431.         if (!$city->hasDistrict($district)) {
  1432.             throw $this->createNotFoundException();
  1433.         }
  1434.         $specs $this->profileListSpecificationService->listByDistrictCheap($district);
  1435.         $response = new Response();
  1436.         $result $this->paginatedListing(
  1437.             $city,
  1438.             null,
  1439.             [],
  1440.             $specs->spec(),
  1441.             null,
  1442.             null,
  1443.             $response
  1444.         );
  1445.         $request->attributes->set('profiles_count'$result->totalCount());
  1446.         return $this->render('ProfileList/list.html.twig', [
  1447.             'profiles' => $result,
  1448.             'source' => $this->source,
  1449.             'source_default' => self::RESULT_SOURCE_CHEAP,
  1450.             'district' => $district,
  1451.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1452.                 'city' => $city->getUriIdentity(),
  1453.                 'district' => $district->getUriIdentity(),
  1454.                 'page' => $this->getCurrentPageNumber(),
  1455.             ]),
  1456.             'recommendationSpec' => $specs->recommendationSpec(),
  1457.         ], response$response);
  1458.     }
  1459.     /**
  1460.      * @Feature("extra_category_cheap")
  1461.      */
  1462.     #[ParamConverter("city"converter"city_converter")]
  1463.     #[Entity("station"expr"repository.ofUriIdentityWithinCity(station, city)")]
  1464.     public function listByStationCheap(Request $requestCity $cityStation $station): Response
  1465.     {
  1466.         if (!$city->hasStation($station)) {
  1467.             throw $this->createNotFoundException();
  1468.         }
  1469.         $specs $this->profileListSpecificationService->listByStationCheap($station);
  1470.         $response = new Response();
  1471.         $result $this->paginatedListing(
  1472.             $city,
  1473.             null,
  1474.             [],
  1475.             $specs->spec(),
  1476.             null,
  1477.             null,
  1478.             $response
  1479.         );
  1480.         $request->attributes->set('profiles_count'$result->totalCount());
  1481.         return $this->render('ProfileList/list.html.twig', [
  1482.             'profiles' => $result,
  1483.             'source' => $this->source,
  1484.             'source_default' => self::RESULT_SOURCE_CHEAP,
  1485.             'station' => $station,
  1486.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1487.                 'city' => $city->getUriIdentity(),
  1488.                 'station' => $station->getUriIdentity(),
  1489.                 'page' => $this->getCurrentPageNumber(),
  1490.             ]),
  1491.             'recommendationSpec' => $specs->recommendationSpec(),
  1492.         ], response$response);
  1493.     }
  1494.     /**
  1495.      * @Feature("extra_category_mature")
  1496.      */
  1497.     #[ParamConverter("city"converter"city_converter")]
  1498.     #[Entity("county"expr"repository.ofUriIdentityWithinCity(county, city)")]
  1499.     public function listByCountyMature(Request $requestCity $cityCounty $county): Response
  1500.     {
  1501.         if (!$city->hasCounty($county)) {
  1502.             throw $this->createNotFoundException();
  1503.         }
  1504.         $specs $this->profileListSpecificationService->listByCountyMature($county);
  1505.         $response = new Response();
  1506.         $result $this->paginatedListing(
  1507.             $city,
  1508.             null,
  1509.             [],
  1510.             $specs->spec(),
  1511.             null,
  1512.             null,
  1513.             $response
  1514.         );
  1515.         $request->attributes->set('profiles_count'$result->totalCount());
  1516.         return $this->render('ProfileList/list.html.twig', [
  1517.             'profiles' => $result,
  1518.             'source' => $this->source,
  1519.             'source_default' => self::RESULT_SOURCE_MATURE,
  1520.             'county' => $county,
  1521.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1522.                 'city' => $city->getUriIdentity(),
  1523.                 'county' => $county->getUriIdentity(),
  1524.                 'page' => $this->getCurrentPageNumber(),
  1525.             ]),
  1526.             'recommendationSpec' => $specs->recommendationSpec(),
  1527.         ], response$response);
  1528.     }
  1529.     /**
  1530.      * @Feature("extra_category_mature")
  1531.      */
  1532.     #[ParamConverter("city"converter"city_converter")]
  1533.     #[Entity("district"expr"repository.ofUriIdentityWithinCity(district, city)")]
  1534.     public function listByDistrictMature(Request $requestCity $cityDistrict $district): Response
  1535.     {
  1536.         if (!$city->hasDistrict($district)) {
  1537.             throw $this->createNotFoundException();
  1538.         }
  1539.         $specs $this->profileListSpecificationService->listByDistrictMature($district);
  1540.         $response = new Response();
  1541.         $result $this->paginatedListing(
  1542.             $city,
  1543.             null,
  1544.             [],
  1545.             $specs->spec(),
  1546.             null,
  1547.             null,
  1548.             $response
  1549.         );
  1550.         $request->attributes->set('profiles_count'$result->totalCount());
  1551.         return $this->render('ProfileList/list.html.twig', [
  1552.             'profiles' => $result,
  1553.             'source' => $this->source,
  1554.             'source_default' => self::RESULT_SOURCE_MATURE,
  1555.             'district' => $district,
  1556.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1557.                 'city' => $city->getUriIdentity(),
  1558.                 'district' => $district->getUriIdentity(),
  1559.                 'page' => $this->getCurrentPageNumber(),
  1560.             ]),
  1561.             'recommendationSpec' => $specs->recommendationSpec(),
  1562.         ], response$response);
  1563.     }
  1564.     /**
  1565.      * @Feature("extra_category_mature")
  1566.      */
  1567.     #[ParamConverter("city"converter"city_converter")]
  1568.     #[Entity("station"expr"repository.ofUriIdentityWithinCity(station, city)")]
  1569.     public function listByStationMature(Request $requestCity $cityStation $station): Response
  1570.     {
  1571.         if (!$city->hasStation($station)) {
  1572.             throw $this->createNotFoundException();
  1573.         }
  1574.         $specs $this->profileListSpecificationService->listByStationMature($station);
  1575.         $response = new Response();
  1576.         $result $this->paginatedListing(
  1577.             $city,
  1578.             null,
  1579.             [],
  1580.             $specs->spec(),
  1581.             null,
  1582.             null,
  1583.             $response
  1584.         );
  1585.         $request->attributes->set('profiles_count'$result->totalCount());
  1586.         return $this->render('ProfileList/list.html.twig', [
  1587.             'profiles' => $result,
  1588.             'source' => $this->source,
  1589.             'source_default' => self::RESULT_SOURCE_MATURE,
  1590.             'station' => $station,
  1591.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1592.                 'city' => $city->getUriIdentity(),
  1593.                 'station' => $station->getUriIdentity(),
  1594.                 'page' => $this->getCurrentPageNumber(),
  1595.             ]),
  1596.             'recommendationSpec' => $specs->recommendationSpec(),
  1597.         ], response$response);
  1598.     }
  1599.     /**
  1600.      * @Feature("extra_category_uzbek")
  1601.      */
  1602.     #[ParamConverter("city"converter"city_converter")]
  1603.     #[Entity("county"expr"repository.ofUriIdentityWithinCity(county, city)")]
  1604.     public function listByCountyUzbek(Request $requestCity $cityCounty $county): Response
  1605.     {
  1606.         if (!$city->hasCounty($county)) {
  1607.             throw $this->createNotFoundException();
  1608.         }
  1609.         $specs $this->profileListSpecificationService->listByCountyUzbek($county);
  1610.         $response = new Response();
  1611.         $result $this->paginatedListing(
  1612.             $city,
  1613.             '/city/{city}/county/{county}/uzbechki',
  1614.             ['city' => $city->getId(), 'county' => $county->getId()],
  1615.             $specs->spec(),
  1616.             null,
  1617.             null,
  1618.             $response
  1619.         );
  1620.         $request->attributes->set('profiles_count'$result->totalCount());
  1621.         return $this->render('ProfileList/list.html.twig', [
  1622.             'profiles' => $result,
  1623.             'source' => $this->source,
  1624.             'source_default' => self::RESULT_SOURCE_UZBEK,
  1625.             'county' => $county,
  1626.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1627.                 'city' => $city->getUriIdentity(),
  1628.                 'county' => $county->getUriIdentity(),
  1629.                 'page' => $this->getCurrentPageNumber(),
  1630.             ]),
  1631.             'recommendationSpec' => $specs->recommendationSpec(),
  1632.         ], response$response);
  1633.     }
  1634.     /**
  1635.      * @Feature("extra_category_uzbek")
  1636.      */
  1637.     #[ParamConverter("city"converter"city_converter")]
  1638.     #[Entity("district"expr"repository.ofUriIdentityWithinCity(district, city)")]
  1639.     public function listByDistrictUzbek(Request $requestCity $cityDistrict $district): Response
  1640.     {
  1641.         if (!$city->hasDistrict($district)) {
  1642.             throw $this->createNotFoundException();
  1643.         }
  1644.         $specs $this->profileListSpecificationService->listByDistrictUzbek($district);
  1645.         $response = new Response();
  1646.         $result $this->paginatedListing(
  1647.             $city,
  1648.             '/city/{city}/district/{district}/uzbechki',
  1649.             ['city' => $city->getId(), 'district' => $district->getId()],
  1650.             $specs->spec(),
  1651.             null,
  1652.             null,
  1653.             $response
  1654.         );
  1655.         $request->attributes->set('profiles_count'$result->totalCount());
  1656.         return $this->render('ProfileList/list.html.twig', [
  1657.             'profiles' => $result,
  1658.             'source' => $this->source,
  1659.             'source_default' => self::RESULT_SOURCE_UZBEK,
  1660.             'district' => $district,
  1661.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1662.                 'city' => $city->getUriIdentity(),
  1663.                 'district' => $district->getUriIdentity(),
  1664.                 'page' => $this->getCurrentPageNumber(),
  1665.             ]),
  1666.             'recommendationSpec' => $specs->recommendationSpec(),
  1667.         ], response$response);
  1668.     }
  1669.     /**
  1670.      * @Feature("extra_category_uzbek")
  1671.      */
  1672.     #[ParamConverter("city"converter"city_converter")]
  1673.     #[Entity("station"expr"repository.ofUriIdentityWithinCity(station, city)")]
  1674.     public function listByStationUzbek(Request $requestCity $cityStation $station): Response
  1675.     {
  1676.         if (!$city->hasStation($station)) {
  1677.             throw $this->createNotFoundException();
  1678.         }
  1679.         $specs $this->profileListSpecificationService->listByStationUzbek($station);
  1680.         $response = new Response();
  1681.         $result $this->paginatedListing(
  1682.             $city,
  1683.             '/city/{city}/station/{station}/uzbechki',
  1684.             ['city' => $city->getId(), 'station' => $station->getId()],
  1685.             $specs->spec(),
  1686.             null,
  1687.             null,
  1688.             $response
  1689.         );
  1690.         $request->attributes->set('profiles_count'$result->totalCount());
  1691.         return $this->render('ProfileList/list.html.twig', [
  1692.             'profiles' => $result,
  1693.             'source' => $this->source,
  1694.             'source_default' => self::RESULT_SOURCE_UZBEK,
  1695.             'station' => $station,
  1696.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1697.                 'city' => $city->getUriIdentity(),
  1698.                 'station' => $station->getUriIdentity(),
  1699.                 'page' => $this->getCurrentPageNumber(),
  1700.             ]),
  1701.             'recommendationSpec' => $specs->recommendationSpec(),
  1702.         ], response$response);
  1703.     }
  1704.     #[ParamConverter("city"converter"city_converter")]
  1705.     #[Route("/api/profiles/listing/city/{city}/price/{priceType}"name"api.profile_listing.by_price"methods"GET"format"json")]
  1706.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1707.     #[OA\Tag(name"ProfileListing")]
  1708.     #[OA\Response(
  1709.         response200,
  1710.         description'',
  1711.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1712.     )]
  1713.     public function listByPrice(Request $requestCountryCurrencyResolver $countryCurrencyResolverCity $citystring $priceTypeint $minPrice nullint $maxPrice null): Response
  1714.     {
  1715.         $specs $this->profileListSpecificationService->listByPrice($city$priceType$minPrice$maxPrice);
  1716.         $response = new Response();
  1717.         $apiEndpoint in_array($priceType, ['low''high''elite']) ? '/city/{city}/price/'.$priceType null;
  1718.         $result $this->paginatedListing($city$apiEndpoint, ['city' => $city->getId()], $specs->spec(), nullnull$response);
  1719.         if ($this->isApiRequest($request)) {
  1720.             return $this->jsonListingResponse($result$city$specs);
  1721.         }
  1722.         return $this->render('ProfileList/list.html.twig', [
  1723.             'profiles' => $result,
  1724.             'source' => $this->source,
  1725.             'source_default' => self::RESULT_SOURCE_BY_PARAMS,
  1726.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1727.                 'city' => $city->getUriIdentity(),
  1728.                 'priceType' => $priceType,
  1729.                 'minPrice' => $minPrice,
  1730.                 'maxPrice' => $maxPrice,
  1731.                 'page' => $this->getCurrentPageNumber()
  1732.             ]),
  1733.             'recommendationSpec' => $specs->recommendationSpec(),
  1734.         ], response$response);
  1735.     }
  1736.     private function processListByPriceEmptyResult(Page $resultCity $citystring $priceTypeint $minPrice nullint $maxPrice null)
  1737.     {
  1738.         if (!$this->features->fill_empty_profile_list())
  1739.             return $result;
  1740.         $this->source self::RESULT_SOURCE_BY_PARAMS;
  1741.         if ($this->countryCurrencyResolver->getCurrencyFor($city->getCountryCode()) == 'RUB') {
  1742.             if ($minPrice && $maxPrice) {
  1743.                 if ($minPrice == 2000 && $maxPrice == 3000) {
  1744.                     $priceSpec = [
  1745.                         ProfileWithApartmentsOneHourPrice::range(15002000),
  1746.                         ProfileWithApartmentsOneHourPrice::range(30004000),
  1747.                     ];
  1748.                 } else if ($minPrice == 3000 && $maxPrice == 4000) {
  1749.                     $priceSpec = [
  1750.                         ProfileWithApartmentsOneHourPrice::range(20003000),
  1751.                         ProfileWithApartmentsOneHourPrice::range(40005000),
  1752.                     ];
  1753.                 } else if ($minPrice == 4000 && $maxPrice == 5000) {
  1754.                     $priceSpec = [
  1755.                         ProfileWithApartmentsOneHourPrice::range(30004000),
  1756.                         ProfileWithApartmentsOneHourPrice::range(50006000),
  1757.                     ];
  1758.                 } else if ($minPrice == 5000 && $maxPrice == 6000) {
  1759.                     $priceSpec = [
  1760.                         ProfileWithApartmentsOneHourPrice::range(4000999999)
  1761.                     ];
  1762.                 } else {
  1763.                     $priceSpec = [
  1764.                         ProfileWithApartmentsOneHourPrice::range($minPrice$maxPrice)
  1765.                     ];
  1766.                 }
  1767.                 $result $this->listRandomSinglePage($citynullnull$priceSpectruefalse);
  1768.             } elseif ($maxPrice) {
  1769.                 if ($maxPrice == 500) {
  1770.                     $priceSpec ProfileWithApartmentsOneHourPrice::cheaperThan(1500);
  1771.                     $result $this->listRandomSinglePage($citynull$priceSpecnulltruefalse);
  1772.                     if ($result->count() == 0) {
  1773.                         $priceSpec ProfileWithApartmentsOneHourPrice::range(15002000);
  1774.                         $result $this->listRandomSinglePage($citynull$priceSpecnulltruefalse);
  1775.                     }
  1776.                 } else if ($maxPrice == 1500) {
  1777.                     $priceSpec ProfileWithApartmentsOneHourPrice::range(15002000);
  1778.                     $result $this->listRandomSinglePage($citynull$priceSpecnulltruefalse);
  1779.                     if ($result->count() == 0) {
  1780.                         $priceSpec ProfileWithApartmentsOneHourPrice::range(20003000);
  1781.                         $result $this->listRandomSinglePage($citynull$priceSpecnulltruefalse);
  1782.                     }
  1783.                 }
  1784.             } else {
  1785.                 $priceThresholds = new ProfilePriceThresholds($city->getCityPriceCategory(), 'RUB');
  1786.                 switch ($priceType) {
  1787.                     case 'not_expensive':
  1788.                         $priceSpec ProfileWithApartmentsOneHourPrice::cheaperThan(2000);
  1789.                         break;
  1790.                     case 'high':
  1791.                         $priceSpec ProfileWithApartmentsOneHourPrice::range(
  1792.                             $priceThresholds->highMinPrice(),
  1793.                             $priceThresholds->highMaxPrice()
  1794.                         );
  1795.                         break;
  1796.                     case 'low':
  1797.                         $priceSpec ProfileWithApartmentsOneHourPrice::cheaperThan($priceThresholds->lowMaxPrice());
  1798.                         break;
  1799.                     case 'elite':
  1800.                         $priceSpec ProfileWithApartmentsOneHourPrice::moreExpensiveThan($priceThresholds->eliteMinPrice());
  1801.                         break;
  1802.                     default:
  1803.                         throw new \LogicException('Unknown price type');
  1804.                         break;
  1805.                 }
  1806.                 $result $this->listRandomSinglePage($citynull$priceSpecnulltruefalse);
  1807.             }
  1808.         }
  1809.         $result $this->checkEmptyResultNotMasseur($result$citynullself::RESULT_SOURCE_CITY);
  1810.         return $result;
  1811.     }
  1812.     #[ParamConverter("city"converter"city_converter")]
  1813.     #[Route("/api/profiles/listing/city/{city}/age/{ageType}"name"api.profile_listing.by_age"methods"GET"format"json")]
  1814.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1815.     #[OA\Tag(name"ProfileListing")]
  1816.     #[OA\Response(
  1817.         response200,
  1818.         description'',
  1819.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1820.     )]
  1821.     public function listByAge(Request $requestCity $citystring $ageTypeint $minAge nullint $maxAge null): Response
  1822.     {
  1823.         $specs $this->profileListSpecificationService->listByAge($ageType$minAge$maxAge);
  1824.         $response = new Response();
  1825.         $apiEndpoint in_array($ageType, ['young''old']) ? '/city/{city}/age/'.$ageType null;
  1826.         $result $this->paginatedListing($city$apiEndpoint, ['city' => $city->getId()], $specs->spec(), nullnull$response);
  1827.         if ($this->isApiRequest($request)) {
  1828.             return $this->jsonListingResponse($result$city$specs);
  1829.         }
  1830.         return $this->render('ProfileList/list.html.twig', [
  1831.             'profiles' => $result,
  1832.             'source' => $this->source,
  1833.             'source_default' => self::RESULT_SOURCE_BY_PARAMS,
  1834.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1835.                 'city' => $city->getUriIdentity(),
  1836.                 'ageType' => $ageType,
  1837.                 'minAge' => $minAge,
  1838.                 'maxAge' => $maxAge,
  1839.                 'page' => $this->getCurrentPageNumber()
  1840.             ]),
  1841.             'recommendationSpec' => $specs->recommendationSpec(),
  1842.         ], response$response);
  1843.     }
  1844.     private function processListByAgeEmptyResult(Page $resultCity $citystring $ageTypeint $minAge nullint $maxAge null)
  1845.     {
  1846.         if (!$this->features->fill_empty_profile_list())
  1847.             return $result;
  1848.         $this->source self::RESULT_SOURCE_BY_PARAMS;
  1849.         if (in_array($ageType, ['young''old'], true)) {
  1850.             return $result;
  1851.         }
  1852.         if ($minAge && !$maxAge) {
  1853.             $startMinAge $minAge;
  1854.             do {
  1855.                 $startMinAge -= 2;
  1856.                 $ageSpec ProfileWithAge::olderThan($startMinAge);
  1857.                 $result $this->listRandomSinglePage($citynull$ageSpecnulltruefalse);
  1858.             } while ($result->count() == && $startMinAge >= 18);
  1859.         } else if ($ageType == 'young') {
  1860.             $startMaxAge 20;
  1861.             do {
  1862.                 $startMaxAge += 2;
  1863.                 $ageSpec ProfileWithAge::youngerThan($startMaxAge);
  1864.                 $result $this->listRandomSinglePage($citynull$ageSpecnulltruefalse);
  1865.             } while ($result->count() == && $startMaxAge <= 100);
  1866.         }
  1867.         $result $this->checkEmptyResultNotMasseur($result$citynullself::RESULT_SOURCE_CITY);
  1868.         return $result;
  1869.     }
  1870.     #[ParamConverter("city"converter"city_converter")]
  1871.     #[Route("/api/profiles/listing/city/{city}/height/{heightType}"name"api.profile_listing.by_height"methods"GET"format"json")]
  1872.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1873.     #[OA\Tag(name"ProfileListing")]
  1874.     #[OA\Response(
  1875.         response200,
  1876.         description'',
  1877.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1878.     )]
  1879.     public function listByHeight(Request $requestCity $citystring $heightType): Response
  1880.     {
  1881.         $specs $this->profileListSpecificationService->listByHeight($heightType);
  1882.         $response = new Response();
  1883.         $result $this->paginatedListing($city'/city/{city}/height/'.$heightType, ['city' => $city->getId()], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  1884.         if ($this->isApiRequest($request)) {
  1885.             return $this->jsonListingResponse($result$city$specs);
  1886.         }
  1887.         return $this->render('ProfileList/list.html.twig', [
  1888.             'profiles' => $result,
  1889.             'source' => $this->source,
  1890.             'source_default' => self::RESULT_SOURCE_BY_PARAMS,
  1891.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1892.                 'city' => $city->getUriIdentity(),
  1893.                 'heightType' => $heightType,
  1894.                 'page' => $this->getCurrentPageNumber()
  1895.             ]),
  1896.             'recommendationSpec' => $specs->recommendationSpec(),
  1897.         ], response$response);
  1898.     }
  1899.     #[ParamConverter("city"converter"city_converter")]
  1900.     #[Route("/api/profiles/listing/city/{city}/breasttype/{breastType}"name"api.profile_listing.by_breast_type"methods"GET"format"json")]
  1901.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1902.     #[OA\Tag(name"ProfileListing")]
  1903.     #[OA\Response(
  1904.         response200,
  1905.         description'',
  1906.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1907.     )]
  1908.     public function listByBreastType(Request $requestCity $citystring $breastType): Response
  1909.     {
  1910.         if (null === $type BreastTypes::getValueByUriIdentity($breastType)) {
  1911.             throw $this->createNotFoundException();
  1912.         }
  1913.         $specs $this->profileListSpecificationService->listByBreastType($breastType);
  1914.         $response = new Response();
  1915.         $alternativeSpec $this->getORSpecForItemsArray(BreastTypes::getList(), function($item): ProfileWithBreastType {
  1916.             return new ProfileWithBreastType($item);
  1917.         });
  1918.         $result $this->paginatedListing($city'/city/{city}/breasttype/'.$type, ['city' => $city->getId()], $specs->spec(), $alternativeSpecself::RESULT_SOURCE_BY_PARAMS$response);
  1919.         if ($this->isApiRequest($request)) {
  1920.             return $this->jsonListingResponse($result$city$specs);
  1921.         }
  1922.         return $this->render('ProfileList/list.html.twig', [
  1923.             'profiles' => $result,
  1924.             'source' => $this->source,
  1925.             'source_default' => self::RESULT_SOURCE_BY_PARAMS,
  1926.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1927.                 'city' => $city->getUriIdentity(),
  1928.                 'breastType' => $breastType,
  1929.                 'page' => $this->getCurrentPageNumber()
  1930.             ]),
  1931.             'recommendationSpec' => $specs->recommendationSpec(),
  1932.         ], response$response);
  1933.     }
  1934.     #[ParamConverter("city"converter"city_converter")]
  1935.     #[Route("/api/profiles/listing/city/{city}/haircolor/{hairColor}"name"api.profile_listing.by_haircolor"methods"GET"format"json")]
  1936.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1937.     #[OA\Tag(name"ProfileListing")]
  1938.     #[OA\Response(
  1939.         response200,
  1940.         description'',
  1941.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1942.     )]
  1943.     public function listByHairColor(Request $requestCity $citystring $hairColor): Response
  1944.     {
  1945.         if (null === $color HairColors::getValueByUriIdentity($hairColor)) {
  1946.             throw $this->createNotFoundException();
  1947.         }
  1948.         $specs $this->profileListSpecificationService->listByHairColor($hairColor);
  1949.         $response = new Response();
  1950.         $alternativeSpec $this->getORSpecForItemsArray(HairColors::getList(), function($item): ProfileWithHairColor {
  1951.             return new ProfileWithHairColor($item);
  1952.         });
  1953.         $result $this->paginatedListing($city'/city/{city}/haircolor/'.$color, ['city' => $city->getId()], $specs->spec(), $alternativeSpecself::RESULT_SOURCE_BY_PARAMS$response);
  1954.         if ($this->isApiRequest($request)) {
  1955.             return $this->jsonListingResponse($result$city$specs);
  1956.         }
  1957.         return $this->render('ProfileList/list.html.twig', [
  1958.             'profiles' => $result,
  1959.             'source' => $this->source,
  1960.             'source_default' => self::RESULT_SOURCE_BY_PARAMS,
  1961.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1962.                 'city' => $city->getUriIdentity(),
  1963.                 'hairColor' => $hairColor,
  1964.                 'page' => $this->getCurrentPageNumber()
  1965.             ]),
  1966.             'recommendationSpec' => $specs->recommendationSpec(),
  1967.         ], response$response);
  1968.     }
  1969.     #[ParamConverter("city"converter"city_converter")]
  1970.     #[Route("/api/profiles/listing/city/{city}/bodytype/{bodyType}"name"api.profile_listing.by_bodytype"methods"GET"format"json")]
  1971.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  1972.     #[OA\Tag(name"ProfileListing")]
  1973.     #[OA\Response(
  1974.         response200,
  1975.         description'',
  1976.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  1977.     )]
  1978.     public function listByBodyType(Request $requestCity $citystring $bodyType): Response
  1979.     {
  1980.         if (null === $type BodyTypes::getValueByUriIdentity($bodyType)) {
  1981.             throw $this->createNotFoundException();
  1982.         }
  1983.         $specs $this->profileListSpecificationService->listByBodyType($bodyType);
  1984.         $response = new Response();
  1985.         $alternativeSpec $this->getORSpecForItemsArray(BodyTypes::getList(), function($item): ProfileWithBodyType {
  1986.             return new ProfileWithBodyType($item);
  1987.         });
  1988.         $result $this->paginatedListing($city'/city/{city}/bodytype/'.$type, ['city' => $city->getId()], $specs->spec(), $alternativeSpecself::RESULT_SOURCE_BY_PARAMS$response);
  1989.         if ($this->isApiRequest($request)) {
  1990.             return $this->jsonListingResponse($result$city$specs);
  1991.         }
  1992.         return $this->render('ProfileList/list.html.twig', [
  1993.             'profiles' => $result,
  1994.             'source' => $this->source,
  1995.             'source_default' => self::RESULT_SOURCE_BY_PARAMS,
  1996.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  1997.                 'city' => $city->getUriIdentity(),
  1998.                 'bodyType' => $bodyType,
  1999.                 'page' => $this->getCurrentPageNumber()
  2000.             ]),
  2001.             'recommendationSpec' => $specs->recommendationSpec(),
  2002.         ], response$response);
  2003.     }
  2004.     #[ParamConverter("city"converter"city_converter")]
  2005.     #[Route("/api/profiles/listing/city/{city}/place/{placeType}"name"api.profile_listing.by_place"methods"GET"format"json")]
  2006.     #[Route("/api/profiles/listing/city/{city}/place/{placeType}/{takeOutLocation}"name"api.profile_listing.by_place.take_out_location"methods"GET"format"json")]
  2007.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2008.     #[OA\Tag(name"ProfileListing")]
  2009.     #[OA\Response(
  2010.         response200,
  2011.         description'',
  2012.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2013.     )]
  2014.     public function listByPlace(Request $requestCity $citystring $placeTypestring $takeOutLocation null): Response
  2015.     {
  2016.         if ('take-out' === $placeType && null !== $takeOutLocation && null === TakeOutLocations::getValueByUriIdentity($takeOutLocation)) {
  2017.             throw $this->createNotFoundException();
  2018.         }
  2019.         $specs $this->profileListSpecificationService->listByPlace($placeType$takeOutLocation);
  2020.         if (null === $specs) {
  2021.             throw $this->createNotFoundException();
  2022.         }
  2023.         $response = new Response();
  2024.         $alternativeSpec $this->getORSpecForItemsArray(TakeOutLocations::getList(), function($item): ProfileIsProvidingTakeOut {
  2025.             return new ProfileIsProvidingTakeOut($item);
  2026.         });
  2027.         if ($placeType === 'take-out') {
  2028.             $alternativeSpec->orX(new ProfileHasApartments());
  2029.         }
  2030.         $apiEndpoint '/city/{city}/place/'.$placeType;
  2031.         if (null !== $takeOutLocation) {
  2032.             $apiEndpoint .= '/'.$takeOutLocation;
  2033.         }
  2034.         $result $this->paginatedListing($city$apiEndpoint, ['city' => $city->getId()], $specs->spec(), $alternativeSpecself::RESULT_SOURCE_BY_PARAMS$response);
  2035.         if ($this->isApiRequest($request)) {
  2036.             return $this->jsonListingResponse($result$city$specs);
  2037.         }
  2038.         return $this->render('ProfileList/list.html.twig', [
  2039.             'profiles' => $result,
  2040.             'source' => $this->source,
  2041.             'source_default' => self::RESULT_SOURCE_BY_PARAMS,
  2042.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  2043.                 'city' => $city->getUriIdentity(),
  2044.                 'placeType' => $placeType,
  2045.                 'takeOutLocation' => TakeOutLocations::getUriIdentity(TakeOutLocations::getValueByUriIdentity($takeOutLocation)),
  2046.                 'page' => $this->getCurrentPageNumber()
  2047.             ]),
  2048.             'recommendationSpec' => $specs->recommendationSpec(),
  2049.         ], response$response);
  2050.     }
  2051.     #[ParamConverter("city"converter"city_converter")]
  2052.     #[Route("/api/profiles/listing/city/{city}/privatehaircut/{privateHaircut}"name"api.profile_listing.by_privatehaircut"methods"GET"format"json")]
  2053.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2054.     #[OA\Tag(name"ProfileListing")]
  2055.     #[OA\Response(
  2056.         response200,
  2057.         description'',
  2058.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2059.     )]
  2060.     public function listByPrivateHaircut(Request $requestCity $citystring $privateHaircut): Response
  2061.     {
  2062.         if(null === $type PrivateHaircuts::getValueByUriIdentity($privateHaircut))
  2063.             throw $this->createNotFoundException();
  2064.         $specs $this->profileListSpecificationService->listByPrivateHaircut($privateHaircut);
  2065.         $response = new Response();
  2066.         $apiEndpoint '/city/{city}/privatehaircut/'.$type;
  2067.         $alternativeSpec $this->getORSpecForItemsArray(PrivateHaircuts::getList(), function($item): ProfileWithPrivateHaircut {
  2068.             return new ProfileWithPrivateHaircut($item);
  2069.         });
  2070.         $result $this->paginatedListing($city$apiEndpoint, ['city' => $city->getId()], $specs->spec(), $alternativeSpecself::RESULT_SOURCE_BY_PARAMS$response);
  2071.         if ($this->isApiRequest($request)) {
  2072.             return $this->jsonListingResponse($result$city$specs);
  2073.         }
  2074.         return $this->render('ProfileList/list.html.twig', [
  2075.             'profiles' => $result,
  2076.             'source' => $this->source,
  2077.             'source_default' => self::RESULT_SOURCE_BY_PARAMS,
  2078.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  2079.                 'city' => $city->getUriIdentity(),
  2080.                 'privateHaircut' => $privateHaircut,
  2081.                 'page' => $this->getCurrentPageNumber()
  2082.             ]),
  2083.             'recommendationSpec' => $specs->recommendationSpec(),
  2084.         ], response$response);
  2085.     }
  2086.     #[ParamConverter("city"converter"city_converter")]
  2087.     #[Route("/api/profiles/listing/city/{city}/nationality/{nationality}"name"api.profile_listing.by_nationality"methods"GET"format"json")]
  2088.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2089.     #[OA\Tag(name"ProfileListing")]
  2090.     #[OA\Response(
  2091.         response200,
  2092.         description'',
  2093.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2094.     )]
  2095.     public function listByNationality(Request $requestCity $citystring $nationality): Response
  2096.     {
  2097.         if (null === $type Nationalities::getValueByUriIdentity($nationality))
  2098.             throw $this->createNotFoundException();
  2099.         $specs $this->profileListSpecificationService->listByNationality($nationality);
  2100.         $response = new Response();
  2101.         $alternativeSpec $this->getORSpecForItemsArray(Nationalities::getList(), function($item): ProfileWithNationality {
  2102.             return new ProfileWithNationality($item);
  2103.         });
  2104.         $apiEndpoint '/city/{city}/nationality/'.$type;
  2105.         $result $this->paginatedListing($city$apiEndpoint, ['city' => $city->getId()], $specs->spec(), $alternativeSpecself::RESULT_SOURCE_BY_PARAMS$response);
  2106.         if ($this->isApiRequest($request)) {
  2107.             return $this->jsonListingResponse($result$city$specs);
  2108.         }
  2109.         return $this->render('ProfileList/list.html.twig', [
  2110.             'profiles' => $result,
  2111.             'source' => $this->source,
  2112.             'source_default' => self::RESULT_SOURCE_BY_PARAMS,
  2113.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  2114.                 'city' => $city->getUriIdentity(),
  2115.                 'nationality' => $nationality,
  2116.                 'page' => $this->getCurrentPageNumber()
  2117.             ]),
  2118.             'recommendationSpec' => $specs->recommendationSpec(),
  2119.         ], response$response);
  2120.     }
  2121.     #[ParamConverter("city"converter"city_converter")]
  2122.     #[ParamConverter("service"options: ['mapping' => ['service' => 'uriIdentity']])]
  2123.     #[Route("/api/profiles/listing/city/{city}/service/{service}"name"api.profile_listing.by_service"methods"GET"format"json")]
  2124.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2125.     #[OA\Tag(name"ProfileListing")]
  2126.     #[OA\Response(
  2127.         response200,
  2128.         description'',
  2129.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2130.     )]
  2131.     public function listByProvidedService(Request $requestCity $cityService $service): Response
  2132.     {
  2133.         $specs $this->profileListSpecificationService->listByProvidedService($service$city);
  2134.         $response = new Response();
  2135.         $sameGroupServices $this->serviceRepository->findBy(['group' => $service->getGroup()]);
  2136.         $alternativeSpec $this->getORSpecForItemsArray([$sameGroupServices], function($item): ProfileIsProvidingOneOfServices {
  2137.             return new ProfileIsProvidingOneOfServices($item);
  2138.         });
  2139.         $result $this->paginatedListing($city'/city/{city}/service/{service}', ['city' => $city->getId(), 'service' => $service->getId()], $specs->spec(), $alternativeSpecself::RESULT_SOURCE_SERVICE$response);
  2140.         if ($this->isApiRequest($request)) {
  2141.             return $this->jsonListingResponse($result$city$specs);
  2142.         }
  2143.         return $this->render('ProfileList/list.html.twig', [
  2144.             'profiles' => $result,
  2145.             'source' => $this->source,
  2146.             'source_default' => self::RESULT_SOURCE_SERVICE,
  2147.             'service' => $service,
  2148.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  2149.                 'city' => $city->getUriIdentity(),
  2150.                 'service' => $service->getUriIdentity(),
  2151.                 'page' => $this->getCurrentPageNumber()
  2152.             ]),
  2153.             'recommendationSpec' => $specs->recommendationSpec(),
  2154.         ], response$response);
  2155.     }
  2156.     /**
  2157.      * @Feature("list_names")
  2158.      */
  2159.     #[ParamConverter("city"converter"city_converter")]
  2160.     #[Route("/api/profiles/listing/city/{city}/names"name"api.profile_listing.names"methods"GET"format"json")]
  2161.     #[OA\Tag(name"ProfileListing")]
  2162.     #[OA\Response(
  2163.         response200,
  2164.         description'Список имен анкет по городу',
  2165.         content: new OA\JsonContent(ref"#/components/schemas/ProfileNamesPage")
  2166.     )]
  2167.     #[Cache(maxage3600, public: true)]
  2168.     public function listNames(Request $requestCity $city): Response
  2169.     {
  2170.         $names $this->profileNameLandingProvider->groupedNamesByCity($city);
  2171.         $popularNames $this->profileNameLandingProvider->popularNamesByCity($city);
  2172.         if ($this->isApiRequest($request)) {
  2173.             return $this->json([
  2174.                 'data' => $names,
  2175.                 'popularNames' => $popularNames,
  2176.             ]);
  2177.         }
  2178.         return parent::render('ProfileNameList/list.html.twig', [
  2179.             'names' => $names,
  2180.             'popularNames' => $popularNames,
  2181.         ]);
  2182.     }
  2183.     /**
  2184.      * @Feature("list_names")
  2185.      */
  2186.     #[ParamConverter("city"converter"city_converter")]
  2187.     #[Route("/api/profiles/listing/city/{city}/name/{name}"name"api.profile_listing.by_name"methods"GET"format"json")]
  2188.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2189.     #[OA\Tag(name"ProfileListing")]
  2190.     #[OA\Response(
  2191.         response200,
  2192.         description'Листинг анкет по имени',
  2193.         content: new OA\JsonContent(ref"#/components/schemas/ProfileNameListingPage")
  2194.     )]
  2195.     #[Cache(maxage3600, public: true)]
  2196.     public function listByName(Request $requestCity $citystring $name): Response
  2197.     {
  2198.         $profileName $this->profileNameLandingProvider->findNameByUri($city$name);
  2199.         if (null === $profileName) {
  2200.             throw $this->createNotFoundException();
  2201.         }
  2202.         $specs = new ProfileListSpecification(new ProfileIdIn($profileName['profileIds']), null);
  2203.         $response = new Response();
  2204.         $result $this->paginatedListing(
  2205.             $city,
  2206.             '/city/{city}/name/{name}',
  2207.             ['city' => $city->getId(), 'name' => $profileName['uriIdentity']],
  2208.             $specs->spec(),
  2209.             null,
  2210.             null,
  2211.             $response
  2212.         );
  2213.         $response->setMaxAge(3600);
  2214.         if ($this->isApiRequest($request)) {
  2215.             return $this->jsonListingResponse($result$city$specs, [
  2216.                 'popularNames' => $this->profileNameLandingProvider->popularNamesByCity($city),
  2217.             ]);
  2218.         }
  2219.         return $this->render('ProfileList/list.html.twig', [
  2220.             'profiles' => $result,
  2221.             'profileName' => $profileName,
  2222.             'popularNames' => $this->profileNameLandingProvider->popularNamesByCity($city),
  2223.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  2224.                 'city' => $city->getUriIdentity(),
  2225.                 'name' => $profileName['uriIdentity'],
  2226.                 'page' => $this->getCurrentPageNumber(),
  2227.             ]),
  2228.             'recommendationSpec' => $specs->recommendationSpec(),
  2229.         ], response$response);
  2230.     }
  2231.     /**
  2232.      * @Feature("has_archive_page")
  2233.      */
  2234.     #[ParamConverter("city"converter"city_converter")]
  2235.     #[Route("/api/profiles/listing/city/{city}/archive"name"api.profile_listing.archive"methods"GET"format"json")]
  2236.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2237.     #[OA\Tag(name"ProfileListing")]
  2238.     #[OA\Response(
  2239.         response200,
  2240.         description'',
  2241.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2242.     )]
  2243.     public function listArchived(Request $requestCity $city): Response
  2244.     {
  2245.         $result $this->profileList->list($citynullnullnullfalsenullProfileList::ORDER_BY_UPDATED);
  2246.         if ($this->isApiRequest($request)) {
  2247.             return $this->jsonListingResponse($result$citynull);
  2248.         }
  2249.         return $this->render('ProfileList/list.html.twig', [
  2250.             'profiles' => $result,
  2251.             'recommendationSpec' => new \App\Specification\ElasticSearch\ProfileIsNotArchived(), //ProfileIsArchived, согласно https://redminez.net/issues/28305 в реках выводятся неарзивные
  2252.         ]);
  2253.     }
  2254.     #[ParamConverter("city"converter"city_converter")]
  2255.     #[Route("/api/profiles/listing/city/{city}/recent"name"api.profile_listing.recent"methods"GET"format"json")]
  2256.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2257.     #[OA\Tag(name"ProfileListing")]
  2258.     #[OA\Response(
  2259.         response200,
  2260.         description'',
  2261.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2262.     )]
  2263.     public function listNew(Request $requestCity $cityint $weeks 2): Response
  2264.     {
  2265.         $specs $this->profileListSpecificationService->listNew($weeks);
  2266.         $response = new Response();
  2267.         $result $this->paginatedListing($city'/city/{city}/recent', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  2268.         if ($this->isApiRequest($request)) {
  2269.             return $this->jsonListingResponse($result$city$specs);
  2270.         }
  2271.         return $this->render('ProfileList/list.html.twig', [
  2272.             'profiles' => $result,
  2273.             'recommendationSpec' => $specs->recommendationSpec(),
  2274.         ], response$response);
  2275.     }
  2276.     #[ParamConverter("city"converter"city_converter")]
  2277.     #[Route("/api/profiles/listing/city/{city}/noretouch"name"api.profile_listing.noretouch"methods"GET"format"json")]
  2278.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2279.     #[OA\Tag(name"ProfileListing")]
  2280.     #[OA\Response(
  2281.         response200,
  2282.         description'',
  2283.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2284.     )]
  2285.     public function listByNoRetouch(Request $requestCity $city): Response
  2286.     {
  2287.         $specs $this->profileListSpecificationService->listByNoRetouch();
  2288.         $response = new Response();
  2289.         $result $this->paginatedListing($city'/city/{city}/noretouch', ['city' => $city->getId()], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  2290.         if ($this->isApiRequest($request)) {
  2291.             return $this->jsonListingResponse($result$city$specs);
  2292.         }
  2293.         return $this->render('ProfileList/list.html.twig', [
  2294.             'profiles' => $result,
  2295.             'profiles_count' => $result->count(),
  2296.             'source' => $this->source,
  2297.             'recommendationSpec' => $specs->recommendationSpec(),
  2298.         ], response$response);
  2299.     }
  2300.     #[ParamConverter("city"converter"city_converter")]
  2301.     #[Route("/api/profiles/listing/city/{city}/nice"name"api.profile_listing.nice"methods"GET"format"json")]
  2302.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2303.     #[OA\Tag(name"ProfileListing")]
  2304.     #[OA\Response(
  2305.         response200,
  2306.         description'',
  2307.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2308.     )]
  2309.     public function listByNice(Request $requestCity $city): Response
  2310.     {
  2311.         $specs $this->profileListSpecificationService->listByNice();
  2312.         $response = new Response();
  2313.         $result $this->paginatedListing($city'/city/{city}/nice', ['city' => $city->getId()], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  2314.         if ($this->isApiRequest($request)) {
  2315.             return $this->jsonListingResponse($result$city$specs);
  2316.         }
  2317.         return $this->render('ProfileList/list.html.twig', [
  2318.             'profiles' => $result,
  2319.             'source' => $this->source,
  2320.             'recommendationSpec' => $specs->recommendationSpec(),
  2321.         ], response$response);
  2322.     }
  2323.     #[ParamConverter("city"converter"city_converter")]
  2324.     #[Route("/api/profiles/listing/city/{city}/oncall"name"api.profile_listing.oncall"methods"GET"format"json")]
  2325.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2326.     #[OA\Tag(name"ProfileListing")]
  2327.     #[OA\Response(
  2328.         response200,
  2329.         description'',
  2330.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2331.     )]
  2332.     public function listByOnCall(Request $requestCity $city): Response
  2333.     {
  2334.         $specs $this->profileListSpecificationService->listByOnCall();
  2335.         $response = new Response();
  2336.         $result $this->paginatedListing($city'/city/{city}/oncall', ['city' => $city->getId()], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  2337.         if ($this->isApiRequest($request)) {
  2338.             return $this->jsonListingResponse($result$city$specs);
  2339.         }
  2340.         return $this->render('ProfileList/list.html.twig', [
  2341.             'profiles' => $result,
  2342.             'source' => $this->source,
  2343.             'recommendationSpec' => $specs->recommendationSpec(),
  2344.         ], response$response);
  2345.     }
  2346.     #[ParamConverter("city"converter"city_converter")]
  2347.     #[Route("/api/profiles/listing/city/{city}/fornight"name"api.profile_listing.fornight"methods"GET"format"json")]
  2348.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2349.     #[OA\Tag(name"ProfileListing")]
  2350.     #[OA\Response(
  2351.         response200,
  2352.         description'',
  2353.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2354.     )]
  2355.     public function listForNight(Request $requestCity $city): Response
  2356.     {
  2357.         $specs $this->profileListSpecificationService->listForNight();
  2358.         $response = new Response();
  2359.         $result $this->paginatedListing($city'/city/{city}/fornight', ['city' => $city->getId()], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  2360.         if ($this->isApiRequest($request)) {
  2361.             return $this->jsonListingResponse($result$city$specs);
  2362.         }
  2363.         return $this->render('ProfileList/list.html.twig', [
  2364.             'profiles' => $result,
  2365.             'source' => $this->source,
  2366.             'recommendationSpec' => $specs->recommendationSpec(),
  2367.         ], response$response);
  2368.     }
  2369.     private function getSpecForEliteGirls(City $city): Filter
  2370.     {
  2371.         $minPrice $this->countryCurrencyResolver->getValueByCountryCode($city->getCountryCode(), [
  2372.             'RUB' => 5000,
  2373.             'UAH' => 1500,
  2374.             'USD' => 100,
  2375.             'EUR' => 130,
  2376.         ]);
  2377.         return new ProfileIsElite($minPrice);
  2378.     }
  2379.     private function getElasticSearchSpecForEliteGirls(City $city): ISpecification
  2380.     {
  2381.         $minPrice $this->countryCurrencyResolver->getValueByCountryCode($city->getCountryCode(), [
  2382.             'RUB' => 5000,
  2383.             'UAH' => 1500,
  2384.             'USD' => 100,
  2385.             'EUR' => 130,
  2386.         ]);
  2387.         return new \App\Specification\ElasticSearch\ProfileIsElite($minPrice);
  2388.     }
  2389.     #[ParamConverter("city"converter"city_converter")]
  2390.     #[Route("/api/profiles/listing/city/{city}/elite"name"api.profile_listing.elite"methods"GET"format"json")]
  2391.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2392.     #[OA\Tag(name"ProfileListing")]
  2393.     #[OA\Response(
  2394.         response200,
  2395.         description'',
  2396.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2397.     )]
  2398.     public function listForEliteGirls(CountryCurrencyResolver $countryCurrencyResolverRequest $requestCity $city): Response
  2399.     {
  2400.         $specs $this->profileListSpecificationService->listForEliteGirls($city);
  2401.         $response = new Response();
  2402.         $result $this->paginatedListing($city'/city/{city}/elite', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  2403.         if ($this->isApiRequest($request)) {
  2404.             return $this->jsonListingResponse($result$city$specs);
  2405.         }
  2406.         return $this->render('ProfileList/list.html.twig', [
  2407.             'profiles' => $result,
  2408.             'source' => $this->source,
  2409.             'source_default' => self::RESULT_SOURCE_BY_PARAMS,
  2410.             'category_url' => $this->generateUrl($request->attributes->get('_route'), [
  2411.                 'city' => $city->getUriIdentity(),
  2412.                 'page' => $this->getCurrentPageNumber()
  2413.             ]),
  2414.             'recommendationSpec' => $specs->recommendationSpec(),
  2415.         ], response$response);
  2416.     }
  2417.     #[ParamConverter("city"converter"city_converter")]
  2418.     #[Route("/api/profiles/listing/city/{city}/realelite"name"api.profile_listing.real_elite"methods"GET"format"json")]
  2419.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2420.     #[OA\Tag(name"ProfileListing")]
  2421.     #[OA\Response(
  2422.         response200,
  2423.         description'',
  2424.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2425.     )]
  2426.     public function listForRealElite(Request $requestCountryCurrencyResolver $countryCurrencyResolverCity $city): Response
  2427.     {
  2428.         $specs $this->profileListSpecificationService->listForRealElite($city);
  2429.         $response = new Response();
  2430.         $result $this->paginatedListing($city'/city/{city}/realelite', ['city' => $city->getId()], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  2431.         if ($this->isApiRequest($request)) {
  2432.             return $this->jsonListingResponse($result$city$specs);
  2433.         }
  2434.         return $this->render('ProfileList/list.html.twig', [
  2435.             'profiles' => $result,
  2436.             'source' => $this->source,
  2437.             'recommendationSpec' => $specs->recommendationSpec(),
  2438.         ], response$response);
  2439.     }
  2440.     #[ParamConverter("city"converter"city_converter")]
  2441.     #[Route("/api/profiles/listing/city/{city}/vip"name"api.profile_listing.vip"methods"GET"format"json")]
  2442.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2443.     #[OA\Tag(name"ProfileListing")]
  2444.     #[OA\Response(
  2445.         response200,
  2446.         description'',
  2447.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2448.     )]
  2449.     public function listForVipPros(Request $requestCountryCurrencyResolver $countryCurrencyResolverCity $city): Response
  2450.     {
  2451.         $specs $this->profileListSpecificationService->listForVipPros($city);
  2452.         $response = new Response();
  2453.         $result $this->paginatedListing($city'/city/{city}/vip', ['city' => $city->getId()], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  2454.         if ($this->isApiRequest($request)) {
  2455.             return $this->jsonListingResponse($result$city$specs);
  2456.         }
  2457.         return $this->render('ProfileList/list.html.twig', [
  2458.             'profiles' => $result,
  2459.             'source' => $this->source,
  2460.             'recommendationSpec' => $specs->recommendationSpec(),
  2461.         ], response$response);
  2462.     }
  2463.     #[ParamConverter("city"converter"city_converter")]
  2464.     #[Route("/api/profiles/listing/city/{city}/vipindi"name"api.profile_listing.vipindi"methods"GET"format"json")]
  2465.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2466.     #[OA\Tag(name"ProfileListing")]
  2467.     #[OA\Response(
  2468.         response200,
  2469.         description'',
  2470.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2471.     )]
  2472.     public function listForVipIndividual(Request $requestCountryCurrencyResolver $countryCurrencyResolverCity $city): Response
  2473.     {
  2474.         $specs $this->profileListSpecificationService->listForVipIndividual($city);
  2475.         $response = new Response();
  2476.         $result $this->paginatedListing($city'/city/{city}/vipindi', ['city' => $city->getId()], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  2477.         if ($this->isApiRequest($request)) {
  2478.             return $this->jsonListingResponse($result$city$specs);
  2479.         }
  2480.         return $this->render('ProfileList/list.html.twig', [
  2481.             'profiles' => $result,
  2482.             'source' => $this->source,
  2483.             'recommendationSpec' => $specs->recommendationSpec(),
  2484.         ], response$response);
  2485.     }
  2486.     #[ParamConverter("city"converter"city_converter")]
  2487.     #[Route("/api/profiles/listing/city/{city}/vipgirls"name"api.profile_listing.vipgirls"methods"GET"format"json")]
  2488.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2489.     #[OA\Tag(name"ProfileListing")]
  2490.     #[OA\Response(
  2491.         response200,
  2492.         description'',
  2493.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2494.     )]
  2495.     public function listForVipGirlsCity(Request $requestCity $city): Response
  2496.     {
  2497.         $specs $this->profileListSpecificationService->listForVipGirlsCity($city);
  2498.         $response = new Response();
  2499.         $result $this->paginatedListing($citynull, [], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  2500.         if ($this->isApiRequest($request)) {
  2501.             return $this->jsonListingResponse($result$city$specs);
  2502.         }
  2503.         return $this->render('ProfileList/list.html.twig', [
  2504.             'profiles' => $result,
  2505.             'source' => $this->source,
  2506.             'recommendationSpec' => $specs->recommendationSpec(),
  2507.         ], response$response);
  2508.     }
  2509.     #[ParamConverter("city"converter"city_converter")]
  2510.     #[Route("/api/profiles/listing/city/{city}/girlfriends"name"api.profile_listing.girlfriends"methods"GET"format"json")]
  2511.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2512.     #[OA\Tag(name"ProfileListing")]
  2513.     #[OA\Response(
  2514.         response200,
  2515.         description'',
  2516.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2517.     )]
  2518.     public function listOfGirlfriends(Request $requestCity $city): Response
  2519.     {
  2520.         $specs $this->profileListSpecificationService->listOfGirlfriends();
  2521.         $response = new Response();
  2522.         $result $this->paginatedListing($citynull, [], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  2523.         if ($this->isApiRequest($request)) {
  2524.             return $this->jsonListingResponse($result$city$specs);
  2525.         }
  2526.         return $this->render('ProfileList/list.html.twig', [
  2527.             'profiles' => $result,
  2528.             'source' => $this->source,
  2529.             'recommendationSpec' => $specs->recommendationSpec(),
  2530.         ]);
  2531.     }
  2532.     #[ParamConverter("city"converter"city_converter")]
  2533.     #[Route("/api/profiles/listing/city/{city}/most_expensive"name"api.profile_listing.most_expensive"methods"GET"format"json")]
  2534.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2535.     #[OA\Tag(name"ProfileListing")]
  2536.     #[OA\Response(
  2537.         response200,
  2538.         description'',
  2539.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2540.     )]
  2541.     public function listOfMostExpensive(Request $requestCity $city): Response
  2542.     {
  2543.         $specs $this->profileListSpecificationService->listOfMostExpensive($city);
  2544.         $response = new Response();
  2545.         $result $this->paginatedListing($citynull, [], $specs->spec(), nullself::RESULT_SOURCE_CITY$response);
  2546.         if ($this->isApiRequest($request)) {
  2547.             return $this->jsonListingResponse($result$city$specs);
  2548.         }
  2549.         return $this->render('ProfileList/list.html.twig', [
  2550.             'profiles' => $result,
  2551.             'source' => $this->source,
  2552.             'recommendationSpec' => $specs->recommendationSpec(),
  2553.         ]);
  2554.     }
  2555.     #[ParamConverter("city"converter"city_converter")]
  2556.     #[Route("/api/profiles/listing/city/{city}/bdsm"name"api.profile_listing.bdsm"methods"GET"format"json")]
  2557.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2558.     #[OA\Tag(name"ProfileListing")]
  2559.     #[OA\Response(
  2560.         response200,
  2561.         description'',
  2562.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2563.     )]
  2564.     public function listBdsm(Request $requestCity $cityServiceRepository $serviceRepositoryParameterBagInterface $parameterBag): Response
  2565.     {
  2566.         $specs $this->profileListSpecificationService->listBdsm();
  2567.         $response = new Response();
  2568.         $result $this->paginatedListing($city'/city/{city}/bdsm', ['city' => $city->getId()], $specs->spec(), nullnull$response);
  2569.         if ($this->isApiRequest($request)) {
  2570.             return $this->jsonListingResponse($result$city$specs);
  2571.         }
  2572.         return $this->render('ProfileList/list.html.twig', [
  2573.             'profiles' => $result,
  2574.             'recommendationSpec' => $specs->recommendationSpec(),
  2575.         ], response$response);
  2576.     }
  2577.     #[ParamConverter("city"converter"city_converter")]
  2578.     #[Route("/api/profiles/listing/city/{city}/gender/{gender}"name"api.profile_listing.by_gender"methods"GET"format"json")]
  2579.     #[OA\Parameter(name"page"in"query"schema: new OA\Schema(type"integer", default: 1minimum1))]
  2580.     #[OA\Tag(name"ProfileListing")]
  2581.     #[OA\Response(
  2582.         response200,
  2583.         description'',
  2584.         content: new OA\JsonContent(ref"#/components/schemas/ProfileListingPage")
  2585.     )]
  2586.     public function listByGender(Request $requestCity $citystring $genderDefaultCityProvider $defaultCityProvider): Response
  2587.     {
  2588.         if ($city->getId() != $defaultCityProvider->getDefaultCity()->getId()) {
  2589.             throw $this->createNotFoundException();
  2590.         }
  2591.         if (null === Genders::getValueByUriIdentity($gender))
  2592.             throw $this->createNotFoundException();
  2593.         $specs $this->profileListSpecificationService->listByGender($gender);
  2594.         $response = new Response();
  2595.         $result $this->paginatedListing($citynull, [], $specs->spec(), nullnull$response);
  2596.         if ($this->isApiRequest($request)) {
  2597.             return $this->jsonListingResponse($result$city$specs);
  2598.         }
  2599.         return $this->render('ProfileList/list.html.twig', [
  2600.             'profiles' => $result,
  2601.             'recommendationSpec' => $specs->recommendationSpec(),
  2602.         ]);
  2603.     }
  2604.     /**
  2605.      * Сейчас не используется, решили доставать их всех соседних подкатегорий разом.
  2606.      * Пока оставил, вдруг передумают.
  2607.      * @deprecated
  2608.      */
  2609.     public function listByNextSimilarCategories(callable $listMethod$requestCategory, array $similarItems): ORMQueryResult
  2610.     {
  2611.         $similarItems array_filter($similarItems, function ($item) use ($requestCategory): bool {
  2612.             return $item != $requestCategory;
  2613.         });
  2614.         //shuffle($similarItems);
  2615.         $item null;
  2616.         $result null;
  2617.         do {
  2618.             $item $item == null current($similarItems) : next($similarItems);
  2619.             if (false === $item)
  2620.                 return $result;
  2621.             $result $listMethod($item);
  2622.         } while ($result->count() == 0);
  2623.         return $result;
  2624.     }
  2625.     private function shouldShowHomepageCityListingsBlock(City $cityint $pagebool $subRequest): bool
  2626.     {
  2627.         if ($page !== 1) {
  2628.             return false;
  2629.         }
  2630.         if ($subRequest) {
  2631.             return true;
  2632.         }
  2633.         return !$city->equals($this->parameterBag->get('default_city'));
  2634.     }
  2635.     protected function getCurrentPageNumber(): int
  2636.     {
  2637.         $page = (int) $this->requestStack->getCurrentRequest()?->get($this->pageParameter1);
  2638.         if ($page 1) {
  2639.             $page 1;
  2640.         }
  2641.         return $page;
  2642.     }
  2643.     protected function render(string $view, array $parameters = [], Response $response null): Response
  2644.     {
  2645.         $parameters $this->fillListingWithRecommendations($parameters);
  2646.         $this->listingService->setCurrentListingPage($parameters['profiles']);
  2647.         $requestAttrs $this->requestStack->getCurrentRequest();
  2648.         if (isset($parameters['profiles']) && is_object($parameters['profiles']) && method_exists($parameters['profiles'], 'totalCount')) {
  2649.             $requestAttrs->attributes->set('profiles_count'$parameters['profiles']->totalCount());
  2650.         }
  2651.         $listing $requestAttrs->get('_controller');
  2652.         $listing is_array($listing) ? $listing[count($listing) - 1] : $listing;
  2653.         $listing preg_replace('/[^:]+::/'''$listing);
  2654.         $listingParameters $requestAttrs->get('_route_params');
  2655.         $listingParameters is_array($listingParameters) ? $listingParameters : [];
  2656.         $mainRequestHasPageParam = isset(($this->requestStack->getMainRequest()->get('_route_params') ?? [])['page']);
  2657.         if ($this->requestStack->getCurrentRequest()->isXmlHttpRequest()) {
  2658.             $view = (
  2659.                 str_starts_with($listing'list')
  2660.                 && 'ProfileList/list.html.twig' === $view
  2661.                 && $mainRequestHasPageParam //isset($listingParameters['page'])
  2662.             )
  2663.                 ? 'ProfileList/list.profiles.html.twig'
  2664.                 $view;
  2665.             return $this->prepareForXhr(parent::render($view$parameters$response));
  2666.             //return $this->getJSONResponse($parameters);
  2667.         } else {
  2668.             $parameters $this->prepareSsrRecommendedProfiles($parameters);
  2669.             $parameters array_merge($parameters, [
  2670.                 'listing' => $listing,
  2671.                 'listing_parameters' => $listingParameters,
  2672.             ]);
  2673.             return parent::render($view$parameters$response);
  2674.         }
  2675.     }
  2676.     private function fillListingWithRecommendations(array $parameters): array
  2677.     {
  2678.         $parameters['recommendations_fill_applied'] = $parameters['recommendations_fill_applied'] ?? false;
  2679.         if (!($parameters['profiles'] ?? null) instanceof Page) {
  2680.             return $parameters;
  2681.         }
  2682.         $city $this->requestStack->getCurrentRequest()?->attributes->get('city');
  2683.         if (!$city instanceof City) {
  2684.             return $parameters;
  2685.         }
  2686.         $filled $this->profileListingRecommendationsFiller->fill(
  2687.             $city,
  2688.             $parameters['profiles'],
  2689.             $this->resolveRecommendationGenders(),
  2690.         );
  2691.         $parameters['profiles'] = $filled['profiles'];
  2692.         $parameters['recommendations_fill_applied'] = $filled['applied'];
  2693.         $parameters['recommendations_fill_original_count'] = $filled['original_count'];
  2694.         $parameters['excludeRecommendationProfileIds'] = array_values(array_unique(array_merge(
  2695.             $parameters['excludeRecommendationProfileIds'] ?? [],
  2696.             $filled['visible_profile_ids'] ?? [],
  2697.         )));
  2698.         return $parameters;
  2699.     }
  2700.     private function prepareSsrRecommendedProfiles(array $parameters): array
  2701.     {
  2702.         if (!empty($parameters['recommendations_fill_applied'])) {
  2703.             return $parameters;
  2704.         }
  2705.         if (isset($parameters['ssr_recommended_profiles']) || !($parameters['profiles'] ?? null) instanceof Page) {
  2706.             return $parameters;
  2707.         }
  2708.         $city $this->requestStack->getCurrentRequest()?->attributes->get('city');
  2709.         if (!$city instanceof City) {
  2710.             return $parameters;
  2711.         }
  2712.         $parameters['ssr_recommended_profiles'] = $this->profileListingRecommendationsFiller->popularProfilesForBlock(
  2713.             $city,
  2714.             $parameters['profiles'],
  2715.             $this->resolveRecommendationGenders(),
  2716.             5,
  2717.             $parameters['excludeRecommendationProfileIds'] ?? [],
  2718.         );
  2719.         return $parameters;
  2720.     }
  2721.     private function resolveRecommendationGenders(): array
  2722.     {
  2723.         $gender $this->requestStack->getCurrentRequest()?->attributes->get('gender');
  2724.         if (is_string($gender) && null !== Genders::getValueByUriIdentity($gender)) {
  2725.             return [Genders::getValueByUriIdentity($gender)];
  2726.         }
  2727.         return [Genders::FEMALE];
  2728.     }
  2729.     private function listActiveWithinCityOrderedByStatusWithSpecAvoidingTopPlacementLimited(
  2730.         City $city,
  2731.         ?Filter $spec,
  2732.         array $additionalSpecs null,
  2733.         array $genders = [Genders::FEMALE],
  2734.         int $limit 0,
  2735.     ): array|Page {
  2736.         return $this->profileList->listActiveWithinCityOrderedByStatusWithSpecLimited($city$spec$additionalSpecs$genderstrue$limit);
  2737.     }
  2738.     private function listRandomSinglePage(
  2739.         City $city,
  2740.         ?string $country,
  2741.         ?Filter $spec,
  2742.         ?array $additionalSpecs,
  2743.         bool $active,
  2744.         ?bool $masseur false,
  2745.         array $genders = [Genders::FEMALE]
  2746.     ): Page {
  2747.         return $this->profileList->listRandom($city$country$spec$additionalSpecs$active$masseur$genderstrue);
  2748.     }
  2749.     private function shuffleProfilesOnPage(Page $result): Page
  2750.     {
  2751.         $profiles iterator_to_array($result->getIterator());
  2752.         if(count($profiles) > 1) {
  2753.             shuffle($profiles);
  2754.         }
  2755.         return new FakeORMQueryPage(
  2756.             $result->getCurrentOffset(),
  2757.             $result->getCurrentPage(),
  2758.             $result->getCurrentLimit(),
  2759.             $result->totalCount(),
  2760.             $profiles
  2761.         );
  2762.     }
  2763.     /**
  2764.      * Достает из списка анкет их id с учетом совместимости разных форматов данных
  2765.      */
  2766.     private function extractProfileIds(array $profiles): array
  2767.     {
  2768.         $ids array_map(static function ($item) {
  2769.             /**
  2770.              * - array - данные из микросервиса ротации через API
  2771.              * - Profile::getId() - полноценная сущность анкеты
  2772.              * - ProfileListingReadModel::$id - read-model анкеты
  2773.              */
  2774.             return is_array($item) ? $item['id'] : ($item?->id ?? $item?->getId());
  2775.         }, $profiles);
  2776.         return array_filter($ids); // remove null values
  2777.     }
  2778. //    protected function getJSONResponse(array $parameters)
  2779. //    {
  2780. //        $request = $this->request;
  2781. //        $data = json_decode($request->getContent(), true);
  2782. //
  2783. //        $imageSize = !empty($data['imageSize']) ? $data['imageSize'] : "357x500";
  2784. //
  2785. //        /** @var FakeORMQueryPage $queryPage */
  2786. //        $queryPage = $parameters['profiles'];
  2787. //
  2788. //        $profiles = array_map(function(ProfileListingReadModel $profile) use ($imageSize) {
  2789. //            $profile->stations = array_values($profile->stations);
  2790. //            $profile->avatar['path'] = $this->responsiveAssetsService->getResponsiveImageUrl($profile->avatar['path'], 'profile_media', $imageSize, 'jpg');
  2791. //            $profile->uri = $this->generateUrl('profile_preview.page', ['city' => $profile->city->uriIdentity, 'profile' => $profile->uriIdentity]);
  2792. //            return $profile;
  2793. //        }, $queryPage->getArray());
  2794. //
  2795. //        return new JsonResponse([
  2796. //            'profiles' => $profiles,
  2797. //            'currentPage' => $queryPage->getCurrentPage(),
  2798. //        ], Response::HTTP_OK);
  2799. //    }
  2800. }