<?php
namespace App\Api\BrcBackend\DTO;
final class CityProfilesList extends PaginationList
{
private array $profiles = [];
private City $city;
/**
* @param array $response
*
* @throws \Exception
*/
public function __construct(array $response)
{
parent::__construct($response);
$this->city = new City($response['city']['id'], $response['city']['name'], $response['city']['slug']);
foreach ($response['items'] as $profile) {
$this->profiles[] = new Profile($profile);
}
}
/**
* @return array<Profile>
*/
public function getProfiles(): array
{
return $this->profiles;
}
/**
* @return City
*/
public function getCity(): City
{
return $this->city;
}
}