PHP Interface CommerceGuys\Addressing\AddressInterface

Field names follow the OASIS "eXtensible Address Language" (xAL) standard: http://www.oasis-open.org/committees/ciq/download.shtml Doesn't include the sub-administrative area (United States: county, Italy: province, Great Britain: county) because it is not required for addressing purposes. Makes no assumptions about mutability. The implementing application can extend the interface to provide setters, or implement a value object that uses either PSR-7 style with* mutators or relies on an AddressBuilder.
See also: CommerceGuys\Addressing\ImmutableAddressInterface
Exibir arquivo Open project: commerceguys/addressing Interface Usage Examples

Public Methods

Method Description
getAdditionalName ( ) : string Gets the additional name.
getAddressLine1 ( ) : string Gets the first line of address block.
getAddressLine2 ( ) : string Gets the second line of address block.
getAdministrativeArea ( ) : string Gets the administrative area.
getCountryCode ( ) : string Gets the two-letter country code.
getDependentLocality ( ) : string Gets the dependent locality (i.e neighbourhood).
getFamilyName ( ) : string Gets the family name (i.e last name).
getGivenName ( ) : string Gets the given name (i.e first name).
getLocale ( ) : string Gets the locale.
getLocality ( ) : string Gets the locality (i.e city).
getOrganization ( ) : string Gets the organization.
getPostalCode ( ) : string Gets the postal code.
getSortingCode ( ) : string Gets the sorting code.

Method Details

getAdditionalName() public method

Can be used to hold a middle name, or a patronymic. If a remote API does not have an additional_name/middle_name parameter, append it to the given name.
public getAdditionalName ( ) : string
return string The additional name.

getAddressLine1() public method

Gets the first line of address block.
public getAddressLine1 ( ) : string
return string The first line of the address block.

getAddressLine2() public method

Gets the second line of address block.
public getAddressLine2 ( ) : string
return string The second line of the address block.

getAdministrativeArea() public method

Called the "state" in the United States, "province" in France and Italy, "county" in Great Britain, "prefecture" in Japan, etc.
public getAdministrativeArea ( ) : string
return string The administrative area. A subdivision code if there are predefined subdivision at this level.

getCountryCode() public method

This is a CLDR country code, since CLDR includes additional countries for addressing purposes, such as Canary Islands (IC).
public getCountryCode ( ) : string
return string The two-letter country code.

getDependentLocality() public method

When representing a double-dependent locality in Great Britain, includes both the double-dependent locality and the dependent locality, e.g. "Whaley, Langwith".
public getDependentLocality ( ) : string
return string The administrative area. A subdivision code if there are predefined subdivision at this level.

getFamilyName() public method

Gets the family name (i.e last name).
public getFamilyName ( ) : string
return string The family name.

getGivenName() public method

Gets the given name (i.e first name).
public getGivenName ( ) : string
return string The given name.

getLocale() public method

Allows the initially-selected address format / subdivision translations to be selected and used the next time this address is modified.
public getLocale ( ) : string
return string The locale.

getLocality() public method

Some countries do not use this field; their address lines are sufficient to locate an address within a sub-administrative area.
public getLocality ( ) : string
return string The administrative area. A subdivision code if there are predefined subdivision at this level.

getOrganization() public method

Gets the organization.
public getOrganization ( ) : string
return string The organization.

getPostalCode() public method

The value is often alphanumeric.
public getPostalCode ( ) : string
return string The postal code.

getSortingCode() public method

For example, CEDEX in France.
public getSortingCode ( ) : string
return string The sorting code.