CountryService
This service class contains methods related to countries.
All public functions are available in the Twig template renderer.
Namespace
IO\Services
Type | Name | Description |
---|---|---|
|
Repository used for manipulating country data |
|
|
Active countries |
Methods
public __construct($countryRepository)
CountryService constructor.
Type |
Name |
Description |
|
Repository used for manipulating country data |
public getActiveCountriesList($lang = null):array
List all active countries
Type |
Name |
Description |
|
Optional: Language for country names |
public getActiveCountryNameMap($language):array
Get a list of names for the active countries
Type |
Name |
Description |
|
Language of names |
public getShippingCountryId():int
Get the id of the current shipping country
public setShippingCountryId($shippingCountryId)
Set the id of the current shipping country
Type |
Name |
Description |
|
Id of shippingCountry |
public getCountryById($countryId):Country
Get a specific Country model by id
Type |
Name |
Description |
|
Id of country |
public getCountryName($countryId, $lang = null):string
Get the name of specific country
Type |
Name |
Description |
|
Id of country to get name from |
|
|
Optional: Language for country name |