countries->getAll(); foreach ($countries as $country) { $key = 'nationality' === $this->property ? $country->getNationality() : $country->getName(); $choices[$key] = $country->getToken(); } return new ArrayChoiceList($choices); } public function loadChoicesForValues(array $values, callable $value = null): array { return $values; } public function loadValuesForChoices(array $choices, callable $value = null): array { return $choices; } }