0

where is method declaration of $this->getAddress() in https://github.com/magento/magento2/blob/develop/app/code/Magento/Directory/Helper/Data.php#L146

public function getRegionCollection()
{
    if (!$this->_regionCollection) {
        $this->_regionCollection = $this->_regCollectionFactory->create();
        $this->_regionCollection->addCountryFilter($this->getAddress()->getCountryId())->load();
    }
    return $this->_regionCollection;
}

i don't know where is method come from, but if i search "function getAddress()", i fount it in Magento\module-customer\Block\Address\Edit https://github.com/magento/magento2/blob/develop/app/code/Magento/Customer/Block/Address/Edit.php#L211

/**
 * Return the associated address.
 *
 * @return \Magento\Customer\Api\Data\AddressInterface
 */
public function getAddress()
{
    return $this->_address;
}

i don't think that class is related

0

It does not exist. Since it is not derived from the Data Object class there are also no magic methods available here.

The only reason this is not raising an error seems to be that this method is not used anywhere: https://github.com/magento/magento2/search?utf8=%E2%9C%93&q=getRegionCollection

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.