CodeExplorer sortStates example
$states =
$this->gateway->
getCountryStates($ids,
$context);
$result =
[];
foreach ($countries as $country) { if (!
$country->
isActive()) { continue;
} if (isset($states[$country->
getId()])) { $country->
setStates( $this->
sortStates($states[$country->
getId()]) );
} $result[$country->
getId()] =
$country;
} return $this->
sortCountries($result);
} /**
* @return int[]
*/