You are here

public function LocalTaxTypeBase::getZones in Commerce Core 8.2

Gets the tax zones.

Return value

\Drupal\commerce_tax\TaxZone[] The tax zones, keyed by ID.

Overrides LocalTaxTypeInterface::getZones

5 calls to LocalTaxTypeBase::getZones()
EuropeanUnionVat::resolveZones in modules/tax/src/Plugin/Commerce/TaxType/EuropeanUnionVat.php
Resolves the tax zones for the given order item and customer profile.
LocalTaxTypeBase::apply in modules/tax/src/Plugin/Commerce/TaxType/LocalTaxTypeBase.php
Applies the tax type to the given order.
LocalTaxTypeBase::buildRateSummary in modules/tax/src/Plugin/Commerce/TaxType/LocalTaxTypeBase.php
Builds the summary of all available tax rates.
LocalTaxTypeBase::getMatchingZones in modules/tax/src/Plugin/Commerce/TaxType/LocalTaxTypeBase.php
Gets the tax zones which match the given address.
LocalTaxTypeBase::matchesRegistrations in modules/tax/src/Plugin/Commerce/TaxType/LocalTaxTypeBase.php
Checks whether the tax type matches the store's tax registrations.

File

modules/tax/src/Plugin/Commerce/TaxType/LocalTaxTypeBase.php, line 335

Class

LocalTaxTypeBase
Provides the base class for local tax types.

Namespace

Drupal\commerce_tax\Plugin\Commerce\TaxType

Code

public function getZones() {
  if (empty($this->zones)) {
    $zones = $this
      ->buildZones();

    // Dispatch an event to allow altering the tax zones.
    $event = new BuildZonesEvent($zones, $this);
    $this->eventDispatcher
      ->dispatch(TaxEvents::BUILD_ZONES, $event);
    $this->zones = $event
      ->getZones();
  }
  return $this->zones;
}