You are here

final class TaxableType in Commerce Core 8.2

Provides taxable types.

Hierarchy

Expanded class hierarchy of TaxableType

5 files declare their use of TaxableType
CanadianSalesTaxTest.php in modules/tax/tests/src/Kernel/Plugin/Commerce/TaxType/CanadianSalesTaxTest.php
commerce_tax.module in modules/tax/commerce_tax.module
Provides tax functionality.
EuropeanUnionVat.php in modules/tax/src/Plugin/Commerce/TaxType/EuropeanUnionVat.php
EuropeanUnionVatTest.php in modules/tax/tests/src/Kernel/Plugin/Commerce/TaxType/EuropeanUnionVatTest.php
TaxTypeBase.php in modules/tax/src/Plugin/Commerce/TaxType/TaxTypeBase.php

File

modules/tax/src/TaxableType.php, line 8

Namespace

Drupal\commerce_tax
View source
final class TaxableType {
  const PHYSICAL_GOODS = 'physical_goods';
  const DIGITAL_GOODS = 'digital_goods';
  const SERVICES = 'services';
  const EVENTS = 'events';

  /**
   * Gets the labels.
   *
   * @return array
   *   An array of labels keyed by taxable type.
   */
  public static function getLabels() {
    return [
      self::PHYSICAL_GOODS => t('Physical goods'),
      self::DIGITAL_GOODS => t('Digital goods'),
      self::SERVICES => t('Services'),
      self::EVENTS => t('Events'),
    ];
  }

  /**
   * Gets the default value.
   *
   * @return string
   *   The default value.
   */
  public static function getDefault() {
    return self::PHYSICAL_GOODS;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TaxableType::DIGITAL_GOODS constant
TaxableType::EVENTS constant
TaxableType::getDefault public static function Gets the default value.
TaxableType::getLabels public static function Gets the labels.
TaxableType::PHYSICAL_GOODS constant
TaxableType::SERVICES constant