PHP Класс CommerceGuys\Tax\Resolver\Context

Includes customer information, store information, and the calculation date.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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() публичный Метод

Gets the customer address.
public getCustomerAddress ( ) : CommerceGuys\Addressing\AddressInterface
Результат CommerceGuys\Addressing\AddressInterface The customer address.

getCustomerTaxNumber() публичный Метод

Gets the customer tax number.
public getCustomerTaxNumber ( ) : string
Результат string The customer tax number.

getDate() публичный Метод

Gets the calculation date.
public getDate ( ) : DateTime
Результат DateTime The calculation date.

getStoreAddress() публичный Метод

Gets the store address.
public getStoreAddress ( ) : CommerceGuys\Addressing\AddressInterface
Результат CommerceGuys\Addressing\AddressInterface The store address.

getStoreRegistrations() публичный Метод

For example, ['UK'], for a US store registered in the UK to collect EU VAT on digital services.
public getStoreRegistrations ( ) : array
Результат array An array of country codes where the store is additionally registered to collect taxes.

setCustomerAddress() публичный Метод

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

setCustomerTaxNumber() публичный Метод

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

setDate() публичный Метод

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

setStoreAddress() публичный Метод

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

setStoreRegistrations() публичный Метод

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

Описание свойств

$customerAddress защищенное свойство

The customer address.
protected AddressInterface,CommerceGuys\Addressing $customerAddress
Результат CommerceGuys\Addressing\AddressInterface

$customerTaxNumber защищенное свойство

The customer's tax number, if provided.
protected string $customerTaxNumber
Результат string

$date защищенное свойство

The calculation date.
protected DateTime $date
Результат DateTime

$storeAddress защищенное свойство

The store address.
protected AddressInterface,CommerceGuys\Addressing $storeAddress
Результат CommerceGuys\Addressing\AddressInterface

$storeRegistrations защищенное свойство

A list of country codes where the store is additionally registered to collect taxes.
protected array $storeRegistrations
Результат array