PHP 클래스 CommerceGuys\Addressing\Subdivision\SubdivisionRepository

상속: implements CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface
파일 보기 프로젝트 열기: commerceguys/addressing

보호된 프로퍼티들

프로퍼티 타입 설명
$addressFormatRepository CommerceGuys\Addressing\AddressFormat\AddressFormatRepository The address format repository.
$definitionPath string The path where subdivision definitions are stored.
$definitions array Subdivision definitions.
$parents array Used as a cache to speed up instantiating subdivisions with the same parent. Contains only parents instead of all instantiated subdivisions to minimize duplicating the data in $this->definitions, thus reducing memory usage.

공개 메소드들

메소드 설명
__construct ( CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface $addressFormatRepository = null, string $definitionPath = null ) Creates a SubdivisionRepository instance.
get ( $code, array $parents )
getAll ( array $parents )
getList ( array $parents, $locale = null )

보호된 메소드들

메소드 설명
buildGroup ( array $parents ) : string Builds a group from the provided parents.
createSubdivisionFromDefinitions ( integer $code, array $definitions ) : Subdivision Creates a subdivision object from the provided definitions.
hasData ( array $parents ) : boolean Checks whether predefined subdivisions exist for the provided parents.
loadDefinitions ( array $parents ) : array Loads the subdivision definitions for the provided parents.
processDefinitions ( array $definitions ) : array Processes the loaded definitions.

메소드 상세

__construct() 공개 메소드

Creates a SubdivisionRepository instance.
public __construct ( CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface $addressFormatRepository = null, string $definitionPath = null )
$addressFormatRepository CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface The address format repository.
$definitionPath string Path to the subdivision definitions.

buildGroup() 보호된 메소드

Used for storing a country's subdivisions of a specific level.
protected buildGroup ( array $parents ) : string
$parents array The parents (country code, subdivision codes).
리턴 string The group.

createSubdivisionFromDefinitions() 보호된 메소드

Creates a subdivision object from the provided definitions.
protected createSubdivisionFromDefinitions ( integer $code, array $definitions ) : Subdivision
$code integer The subdivision code.
$definitions array The subdivision definitions.
리턴 Subdivision

get() 공개 메소드

public get ( $code, array $parents )
$parents array

getAll() 공개 메소드

public getAll ( array $parents )
$parents array

getList() 공개 메소드

public getList ( array $parents, $locale = null )
$parents array

hasData() 보호된 메소드

Checks whether predefined subdivisions exist for the provided parents.
protected hasData ( array $parents ) : boolean
$parents array The parents (country code, subdivision codes).
리턴 boolean TRUE if predefined subdivisions exist for the provided parents, FALSE otherwise.

loadDefinitions() 보호된 메소드

Loads the subdivision definitions for the provided parents.
protected loadDefinitions ( array $parents ) : array
$parents array The parents (country code, subdivision codes).
리턴 array The subdivision definitions.

processDefinitions() 보호된 메소드

Adds keys and values that were removed from the JSON files for brevity.
protected processDefinitions ( array $definitions ) : array
$definitions array The definitions.
리턴 array The processed definitions.

프로퍼티 상세

$addressFormatRepository 보호되어 있는 프로퍼티

The address format repository.
protected AddressFormatRepository,CommerceGuys\Addressing\AddressFormat $addressFormatRepository
리턴 CommerceGuys\Addressing\AddressFormat\AddressFormatRepository

$definitionPath 보호되어 있는 프로퍼티

The path where subdivision definitions are stored.
protected string $definitionPath
리턴 string

$definitions 보호되어 있는 프로퍼티

Subdivision definitions.
protected array $definitions
리턴 array

$parents 보호되어 있는 프로퍼티

Used as a cache to speed up instantiating subdivisions with the same parent. Contains only parents instead of all instantiated subdivisions to minimize duplicating the data in $this->definitions, thus reducing memory usage.
protected array $parents
리턴 array