PHP 클래스 CommerceGuys\Addressing\AddressFormat\AddressFormat

파일 보기 프로젝트 열기: commerceguys/addressing 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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