/**
* @internal
*/
public function __construct( private readonly AbstractCountryStateRoute
$countryStateRoute,
private readonly EventDispatcherInterface
$eventDispatcher ) { } public function load(string
$countryId, Request
$request, SalesChannelContext
$context): CountryStateDataPagelet
{ $page =
new CountryStateDataPagelet();
$criteria =
new Criteria();
$this->eventDispatcher->
dispatch(new CountryStateDataPageletCriteriaEvent($criteria,
$context,
$request));
$countryRouteResponse =
$this->countryStateRoute->
load($countryId,
$request,
$criteria,
$context);
$page->
setStates($countryRouteResponse->
getStates());
$this->eventDispatcher->
dispatch(new CountryStateDataPageletLoadedEvent($page,
$context,
$request));