PHP Class CommerceGuys\Tax\Resolver\Context

Includes customer information, store information, and the calculation date.
Afficher le fichier Open project: commerceguys/tax Class Usage Examples

Protected Properties

Свойство Type Description
$customerAddress CommerceGuys\Addressing\AddressInterface The customer address.
$customerTaxNumber string The customer's tax number, if provided.
$date DateTime The calculation date.
$storeAddress CommerceGuys\Addressing\AddressInterface The store address.
$storeRegistrations array A list of country codes where the store is additionally registered to collect taxes.

Méthodes publiques

Méthode Description
__construct ( CommerceGuys\Addressing\AddressInterface $customerAddress, CommerceGuys\Addressing\AddressInterface $storeAddress, string $customerTaxNumber = '', array $storeRegistrations = [], DateTime $date = null ) Creates a Context instance.
getCustomerAddress ( ) : CommerceGuys\Addressing\AddressInterface Gets the customer address.
getCustomerTaxNumber ( ) : string Gets the customer tax number.
getDate ( ) : DateTime Gets the calculation date.
getStoreAddress ( ) : CommerceGuys\Addressing\AddressInterface Gets the store address.
getStoreRegistrations ( ) : array Gets the store registrations.
setCustomerAddress ( CommerceGuys\Addressing\AddressInterface $customerAddress ) Sets the customer address.
setCustomerTaxNumber ( string $customerTaxNumber ) Sets the customer tax number.
setDate ( DateTime $date ) Sets the calculation date.
setStoreAddress ( CommerceGuys\Addressing\AddressInterface $storeAddress ) Sets the store address.
setStoreRegistrations ( array $storeRegistrations ) Sets the store registrations.

Method Details

__construct() public méthode

Creates a Context instance.
public __construct ( CommerceGuys\Addressing\AddressInterface $customerAddress, CommerceGuys\Addressing\AddressInterface $storeAddress, string $customerTaxNumber = '', array $storeRegistrations = [], DateTime $date = null )
$customerAddress CommerceGuys\Addressing\AddressInterface
$storeAddress CommerceGuys\Addressing\AddressInterface
$customerTaxNumber string
$storeRegistrations array
$date DateTime

getCustomerAddress() public méthode

Gets the customer address.
public getCustomerAddress ( ) : CommerceGuys\Addressing\AddressInterface
Résultat CommerceGuys\Addressing\AddressInterface The customer address.

getCustomerTaxNumber() public méthode

Gets the customer tax number.
public getCustomerTaxNumber ( ) : string
Résultat string The customer tax number.

getDate() public méthode

Gets the calculation date.
public getDate ( ) : DateTime
Résultat DateTime The calculation date.

getStoreAddress() public méthode

Gets the store address.
public getStoreAddress ( ) : CommerceGuys\Addressing\AddressInterface
Résultat CommerceGuys\Addressing\AddressInterface The store address.

getStoreRegistrations() public méthode

For example, ['UK'], for a US store registered in the UK to collect EU VAT on digital services.
public getStoreRegistrations ( ) : array
Résultat array An array of country codes where the store is additionally registered to collect taxes.

setCustomerAddress() public méthode

Sets the customer address.
public setCustomerAddress ( CommerceGuys\Addressing\AddressInterface $customerAddress )
$customerAddress CommerceGuys\Addressing\AddressInterface The customer address.

setCustomerTaxNumber() public méthode

Sets the customer tax number.
public setCustomerTaxNumber ( string $customerTaxNumber )
$customerTaxNumber string The customer tax number.

setDate() public méthode

Sets the calculation date.
public setDate ( DateTime $date )
$date DateTime The calculation date.

setStoreAddress() public méthode

Sets the store address.
public setStoreAddress ( CommerceGuys\Addressing\AddressInterface $storeAddress )
$storeAddress CommerceGuys\Addressing\AddressInterface The store address.

setStoreRegistrations() public méthode

Sets the store registrations.
public setStoreRegistrations ( array $storeRegistrations )
$storeRegistrations array An array of country codes.

Property Details

$customerAddress protected_oe property

The customer address.
protected AddressInterface,CommerceGuys\Addressing $customerAddress
Résultat CommerceGuys\Addressing\AddressInterface

$customerTaxNumber protected_oe property

The customer's tax number, if provided.
protected string $customerTaxNumber
Résultat string

$date protected_oe property

The calculation date.
protected DateTime $date
Résultat DateTime

$storeAddress protected_oe property

The store address.
protected AddressInterface,CommerceGuys\Addressing $storeAddress
Résultat CommerceGuys\Addressing\AddressInterface

$storeRegistrations protected_oe property

A list of country codes where the store is additionally registered to collect taxes.
protected array $storeRegistrations
Résultat array