if (empty($id)) { throw new ParameterMissingException('id'
);
} $filters =
[ [ 'property' => 'countries.id',
'expression' => '=',
'value' =>
$id,
],
];
$builder =
$this->
getRepository()->
getCountriesWithStatesQueryBuilder($filters);
/** @var CountryModel|null $country */
$country =
$builder->
getQuery()->
getOneOrNullResult($this->
getResultMode());
if (!
$country) { throw new NotFoundException(sprintf('Country by id %d not found',
$id));
} return $country;
} /**
* Returns an array containing the total count of existing countries as well as the data of countries
* that match the given criteria.
*
* @param int $offset
* @param int $limit
*
* @return array
*/