use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
use Shopware\Core\Framework\Log\Package;
/**
* @extends EntityCollection<CountryEntity>
*/
#[Package('core')]
class CountryCollection extends EntityCollection
{ public function sortCountryAndStates(): void
{ $this->
sortByPositionAndName();
foreach ($this->
getIterator() as $country) { if ($country->
getStates()) { $country->
getStates()->
sortByPositionAndName();
} } } public function sortByPositionAndName(): void
{ uasort($this->elements,
static function DCountryEntity
$a, CountryEntity
$b) {