src/Service/Top100/Top100ProfileQueryService.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Service\Top100;
  3. use App\Dto\Top100\Top100ProfileQueryByIdsDTO;
  4. use App\Dto\Top100\Top100ProfileQueryRandomDTO;
  5. use App\Service\ProfileList;
  6. use App\Specification\Profile\ProfileIdINOrderedByINValues;
  7. final class Top100ProfileQueryService
  8. {
  9.     public function __construct(private ProfileList $profileList) {}
  10.     public function getActiveProfilesByIds(Top100ProfileQueryByIdsDTO $dto): array
  11.     {
  12.         return $this->profileList->listActiveWithinCityOrderedByStatusWithSpecLimited(
  13.             $dto->city,
  14.             new ProfileIdINOrderedByINValues($dto->ids),
  15.             $dto->filters,
  16.             $dto->genders,
  17.             false,
  18.             $dto->limit,
  19.         );
  20.     }
  21.     public function createFakePageFromProfiles(int $total, array $profiles): \Porpaginas\Page
  22.     {
  23.         return $this->profileList->createFakePageFromProfiles($total$profiles);
  24.     }
  25.     public function getRandomProfiles(Top100ProfileQueryRandomDTO $dto): array
  26.     {
  27.         return $this->profileList->listRandom(
  28.             $dto->city,
  29.             $dto->district,
  30.             $dto->station,
  31.             $dto->filters,
  32.             false,
  33.             $dto->excludeHidden,
  34.             $dto->genders,
  35.             $dto->withPhoto,
  36.             $dto->limit,
  37.         );
  38.     }
  39. }