PHP Класс CommerceGuys\Addressing\AddressFormat\AddressFormat

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$administrativeAreaType string The administrative area type.
$countryCode string The country code.
$dependentLocalityType string The dependent locality type.
$format string The format string.
$groupedFields array The used fields, grouped by line.
$localFormat string The local format string.
$locale string The locale.
$localityType string The locality type.
$postalCodePattern string The postal code pattern.
$postalCodePrefix string The postal code prefix.
$postalCodeType string The postal code type.
$requiredFields array The required fields.
$subdivisionDepth integer The subdivision depth.
$uppercaseFields string The fields that need to be uppercased.
$usedFields array The used fields.

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

Метод Описание
__construct ( array $definition ) Creates a new AddressFormat instance.
getAdministrativeAreaType ( ) : string | null Gets the administrative area type.
getCountryCode ( ) : string Gets the two-letter country code.
getDependentLocalityType ( ) : string | null Gets the dependent locality type.
getFormat ( ) : string Gets the format string.
getLocalFormat ( ) : string | null Gets the local format string.
getLocale ( ) : string | null Gets the locale.
getLocalityType ( ) : string | null Gets the locality type.
getPostalCodePattern ( ) : string | null Gets the postal code pattern.
getPostalCodePrefix ( ) : string | null Gets the postal code prefix.
getPostalCodeType ( ) : string | null Gets the postal code type.
getRequiredFields ( ) : array Gets the list of required fields.
getSubdivisionDepth ( ) : integer Gets the subdivision depth.
getUppercaseFields ( ) : array Gets the list of fields that need to be uppercased.
getUsedFields ( ) : array Gets the list of used fields.
getUsedSubdivisionFields ( ) : array Gets the list of used subdivision fields.

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

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

Creates a new AddressFormat instance.
public __construct ( array $definition )
$definition array The definition array.

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

Used for presenting the correct label to the end-user.
public getAdministrativeAreaType ( ) : string | null
Результат string | null The administrative area type, or null if the administrative area field isn't used.

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

This is a CLDR country code, since CLDR includes additional countries for addressing purposes, such as Canary Islands (IC).
public getCountryCode ( ) : string
Результат string The two-letter country code.

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

Used for presenting the correct label to the end-user.
public getDependentLocalityType ( ) : string | null
Результат string | null The dependent locality type, or null if the dependent locality field isn't used.

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

Defines the layout of an address, and consists of tokens (address fields prefixed with a '%') separated by unix newlines (\n). Example: %givenName %familyName %organization %addressLine1 %addressLine2 %locality %administrativeArea %postalCode
public getFormat ( ) : string
Результат string The format string.

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

Defined for countries that use a different ordering of fields when the address is entered in the native script. For example, China uses a major-to-minor format (country first, name last) when the address is entered in Chinese.
public getLocalFormat ( ) : string | null
Результат string | null The local format string, if defined.

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

Only defined if the country has a local format.
public getLocale ( ) : string | null
Результат string | null The locale, if defined.

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

Used for presenting the correct label to the end-user.
public getLocalityType ( ) : string | null
Результат string | null The locality type, or null if the locality field isn't used.

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

This is a regular expression pattern used to validate postal codes. Ignored if a subdivision defines its own full postal code pattern (E.g. Hong Kong when specified as a Chinese province).
public getPostalCodePattern ( ) : string | null
Результат string | null The postal code pattern.

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

The prefix is optional and added to postal codes only when formatting an address for international mailing, as recommended by postal services.
public getPostalCodePrefix ( ) : string | null
Результат string | null The postal code prefix.

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

Used for presenting the correct label to the end-user.
public getPostalCodeType ( ) : string | null
Результат string | null The postal code type, or null if the postal code field isn't used.

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

Gets the list of required fields.
public getRequiredFields ( ) : array
Результат array An array of address fields.

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

Indicates the number of levels of predefined subdivisions. Note that a country might use a subdivision field without having predefined subdivisions for it. For example, if the locality field is used by the address format, but the subdivision depth is 1, that means that the field element should be rendered as a textbox, since there's no known data to put in a dropdown. It is also possible to have no subdivisions for specific parents, even though the country generally has predefined subdivisions at that depth.
public getSubdivisionDepth ( ) : integer
Результат integer The subdivision depth. Possible values: 0: no subdivisions have been predefined. 1: administrative areas. 2: administrative areas, localities. 3: administrative areas, localities, dependent localities.

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

Gets the list of fields that need to be uppercased.
public getUppercaseFields ( ) : array
Результат array An array of address fields.

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

Gets the list of used fields.
public getUsedFields ( ) : array
Результат array An array of address fields.

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

Gets the list of used subdivision fields.
public getUsedSubdivisionFields ( ) : array
Результат array An array of address fields.

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

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

The administrative area type.
protected string $administrativeAreaType
Результат string

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

The country code.
protected string $countryCode
Результат string

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

The dependent locality type.
protected string $dependentLocalityType
Результат string

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

The format string.
protected string $format
Результат string

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

The used fields, grouped by line.
protected array $groupedFields
Результат array

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

The local format string.
protected string $localFormat
Результат string

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

The locale.
protected string $locale
Результат string

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

The locality type.
protected string $localityType
Результат string

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

The postal code pattern.
protected string $postalCodePattern
Результат string

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

The postal code prefix.
protected string $postalCodePrefix
Результат string

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

The postal code type.
protected string $postalCodeType
Результат string

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

The required fields.
protected array $requiredFields
Результат array

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

The subdivision depth.
protected int $subdivisionDepth
Результат integer

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

The fields that need to be uppercased.
protected string $uppercaseFields
Результат string

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

The used fields.
protected array $usedFields
Результат array