PHP Class CommerceGuys\Tax\Resolver\TaxType\EuTaxTypeResolver

Inheritance: implements CommerceGuys\Tax\Resolver\TaxType\TaxTypeResolverInterface, use trait StoreRegistrationCheckerTrait
Show file Open project: commerceguys/tax

Protected Properties

Property Type Description
$taxTypeRepository The tax type repository.

Public Methods

Method Description
__construct ( CommerceGuys\Tax\Repository\TaxTypeRepositoryInterface $taxTypeRepository ) Creates a EuTaxTypeResolver instance.
resolve ( CommerceGuys\Tax\TaxableInterface $taxable, Context $context )

Protected Methods

Method Description
filterByAddress ( array $taxTypes, CommerceGuys\Addressing\AddressInterface $address ) : CommerceGuys\Tax\Model\TaxTypeInterface[] Filters out tax types not matching the provided address.
getTaxTypes ( ) : CommerceGuys\Tax\Model\TaxTypeInterface[] Returns the EU tax types.

Method Details

__construct() public method

Creates a EuTaxTypeResolver instance.
public __construct ( CommerceGuys\Tax\Repository\TaxTypeRepositoryInterface $taxTypeRepository )
$taxTypeRepository CommerceGuys\Tax\Repository\TaxTypeRepositoryInterface The tax type repository.

filterByAddress() protected method

Filters out tax types not matching the provided address.
protected filterByAddress ( array $taxTypes, CommerceGuys\Addressing\AddressInterface $address ) : CommerceGuys\Tax\Model\TaxTypeInterface[]
$taxTypes array The tax types to filter.
$address CommerceGuys\Addressing\AddressInterface The address to filter by.
return CommerceGuys\Tax\Model\TaxTypeInterface[] An array of tax types whose zones match the provided address.

getTaxTypes() protected method

Returns the EU tax types.
protected getTaxTypes ( ) : CommerceGuys\Tax\Model\TaxTypeInterface[]
return CommerceGuys\Tax\Model\TaxTypeInterface[] An array of EU tax types.

resolve() public method

public resolve ( CommerceGuys\Tax\TaxableInterface $taxable, Context $context )
$taxable CommerceGuys\Tax\TaxableInterface
$context CommerceGuys\Tax\Resolver\Context

Property Details

$taxTypeRepository protected property

The tax type repository.
protected $taxTypeRepository