Property | Type | Description | |
---|---|---|---|
$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. |
Method | Description | |
---|---|---|
__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 ) |
Method | Description | |
---|---|---|
buildGroup ( array $parents ) : string | Builds a group from the provided parents. | |
createSubdivisionFromDefinitions ( integer $code, array $definitions ) : |
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. |
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. |
protected buildGroup ( array $parents ) : string | ||
$parents | array | The parents (country code, subdivision codes). |
return | string | The group. |
protected createSubdivisionFromDefinitions ( integer $code, array $definitions ) : |
||
$code | integer | The subdivision code. |
$definitions | array | The subdivision definitions. |
return |
protected loadDefinitions ( array $parents ) : array | ||
$parents | array | The parents (country code, subdivision codes). |
return | array | The subdivision definitions. |
protected processDefinitions ( array $definitions ) : array | ||
$definitions | array | The definitions. |
return | array | The processed definitions. |
protected AddressFormatRepository,CommerceGuys\Addressing\AddressFormat $addressFormatRepository | ||
return |
protected string $definitionPath | ||
return | string |
protected array $definitions | ||
return | array |
protected array $parents | ||
return | array |