PHP Interface CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface

Show file Open project: commerceguys/addressing Interface Usage Examples

Public Methods

Method Description
get ( string $code, array $parents ) : Subdivision | null Returns a subdivision instance matching the provided code and parents.
getAll ( array $parents ) : Subdivision[] Returns all subdivision instances for the provided parents.
getList ( array $parents, string $locale = null ) : array Returns a list of subdivisions for the provided parents.

Method Details

get() public method

Returns a subdivision instance matching the provided code and parents.
public get ( string $code, array $parents ) : Subdivision | null
$code string The subdivision code.
$parents array The parents (country code, subdivision codes).
return Subdivision | null The subdivision instance, if found.

getAll() public method

Returns all subdivision instances for the provided parents.
public getAll ( array $parents ) : Subdivision[]
$parents array The parents (country code, subdivision codes).
return Subdivision[] An array of subdivision instances.

getList() public method

Returns a list of subdivisions for the provided parents.
public getList ( array $parents, string $locale = null ) : array
$parents array The parents (country code, subdivision codes).
$locale string The locale (e.g. fr-FR).
return array An array of subdivision names, keyed by code.