VatNumber
class
VatNumber
Properties summary
Type | Property | Description | |
---|---|---|---|
protected string | $identifier | ||
protected string | $prefix | ||
protected string | $number |
Methods summary
Return Type | Method Name | Description | |
---|---|---|---|
static VatNumber | factoryFromIdentifier(string $identifier) | - | |
static VatNumber | factoryFromInput(string $input) | Create new instance, normalizing input prior to instantiation | |
static string | normalizeIdentifierInput(string $input) | - | |
array | parseIdentifier(string $identifier) | - | |
string | getIdentifier() | Full string representation of a VAT number | |
string | getPrefix() | (country) prefix related to the VAT number. | |
string | getNumber() | The number portion of the VAT number (ie, sans any prefix). Note while by convention this is named a number, there may be alpha characters present. | |
bool | isUK() | Should the VAT number be treated as belonging to a UK business entity | |
bool | isEU() | Should the VAT number be treated as belonging to a country in the EEA | |
bool | isValid() | - |
Details
static VatNumber
factoryFromIdentifier (string $identifier)
static VatNumber
factoryFromInput (string $input)
Create new instance, normalizing input prior to instantiation
static protected string
normalizeIdentifierInput (string $input)
protected array
parseIdentifier (string $identifier)
string
getIdentifier ()
Full string representation of a VAT number
string
getPrefix ()
(country) prefix related to the VAT number.
WHMCS has a legacy that UK VAT number may or may not have the GB prefix.
string
getNumber ()
The number portion of the VAT number (ie, sans any prefix). Note while by convention this is named a number, there may be alpha characters present.
bool
isUK ()
Should the VAT number be treated as belonging to a UK business entity
bool
isEU ()
Should the VAT number be treated as belonging to a country in the EEA