In my subscriber I was trying to load some customer addresses. Somehow $address-\>getCountry()
returns null
:
$addresses = $this->addressRepository->search(new Criteria(), Context::createDefaultContext());
foreach ($addresses as $address) {
$address->getFirstName(); // this works
$address->getCountryId(); // this returns a string
$address->getCountry(); // !!!null!!!
}
Questions: Why does address-\>getCountry()
return null
? How do I get the associated country?
Thanks