CommerceGuys\Tax\Resolver\TaxType\StoreRegistrationCheckerTrait::checkStoreRegistration PHP Метод

checkStoreRegistration() защищенный Метод

Checks whether the store is registered to collect taxes in the given zone.
protected checkStoreRegistration ( CommerceGuys\Zone\Model\ZoneInterface $zone, Context $context ) : boolean
$zone CommerceGuys\Zone\Model\ZoneInterface The zone.
$context CommerceGuys\Tax\Resolver\Context The context containing store information.
Результат boolean True if the store is registered to collect taxes in the given zone, false otherwise.
    protected function checkStoreRegistration(ZoneInterface $zone, Context $context)
    {
        $storeRegistrations = $context->getStoreRegistrations();
        foreach ($storeRegistrations as $country) {
            if (!isset($this->emptyAddresses[$country])) {
                $this->emptyAddresses[$country] = new Address($country);
            }
            if ($zone->match($this->emptyAddresses[$country])) {
                return true;
            }
        }
        return false;
    }