You are here

public function TaxZone::match in Commerce Core 8.2

Checks whether the given address belongs to the zone.

Parameters

\CommerceGuys\Addressing\AddressInterface $address: The address.

Return value

bool TRUE if the address belongs to the zone, FALSE otherwise.

File

modules/tax/src/TaxZone.php, line 198

Class

TaxZone
Represents a tax zone.

Namespace

Drupal\commerce_tax

Code

public function match(AddressInterface $address) {
  foreach ($this->territories as $territory) {
    if ($territory
      ->match($address)) {
      return TRUE;
    }
  }
  return FALSE;
}