CountryServiceInterface
in
Interface CountryServiceInterface
Tags
Table of Contents
- countryHasCountryZones() : bool
- Method to check if a country has country zones
- countryZoneExistsInCountry() : bool
- Method to check if a country zone exists in a country
- findCountryByIso2() : CustomerCountryInterface
- Find country by iso2 code.
- findCountryByName() : CustomerCountryInterface
- Find country by name.
- findCountryZoneByNameAndCountry() : CustomerCountryZoneInterface|null
- This method returns a CustomerCountryZone object if found. Otherwise null will be returned.
- findCountryZoneByZoneCodeAndCountry() : CustomerCountryZoneInterface|null
- Finds the country zone by the given zone code and country.
- findCountryZoneByZoneCodeAndCountryId() : CustomerCountryZoneInterface
- Returns the country zone by the given zone code and country id.
- findCountryZonesByCountryId() : array<string|int, mixed>
- This method will return an array of CustomerCountryZone objects found by the country ID. If the country has no zones, an empty array will be returned
- getCountries() : CustomerCountryCollection
- Method to get all countries
- getCountryById() : CustomerCountryInterface
- Method to get a country with a given id
- getCountryByIso2() : CustomerCountryInterface
- Get country by iso2 code.
- getCountryByName() : CustomerCountryInterface
- Get country by name.
- getCountryZoneByNameAndCountry() : CustomerCountryZoneInterface
- Method to get a country with a given name and country
- getCountryZoneByZoneCodeAndCountry() : CustomerCountryZoneInterface
- Returns the country zone by the given zone code and country.
- getCountryZoneByZoneCodeAndCountryId() : CustomerCountryZoneInterface
- Returns the country zone by the given zone code and country id.
- getUnknownCountryZoneByName() : CustomerCountryZone
- This method will return a new CustomerCountryZone object representing an unknown country zone.
- isStateMandatory() : bool
- This method returns whether the specified country, necessary, needs a state.
Methods
countryHasCountryZones()
Method to check if a country has country zones
public
countryHasCountryZones(CustomerCountryInterface $customerCountry) : bool
Parameters
- $customerCountry : CustomerCountryInterface
Return values
bool —countryZoneExistsInCountry()
Method to check if a country zone exists in a country
public
countryZoneExistsInCountry(CustomerCountryZoneInterface $customerCountryZone, CustomerCountryInterface $customerCountry) : bool
Parameters
- $customerCountryZone : CustomerCountryZoneInterface
- $customerCountry : CustomerCountryInterface
Return values
bool —findCountryByIso2()
Find country by iso2 code.
public
findCountryByIso2(string $p_countryIso2) : CustomerCountryInterface
Parameters
- $p_countryIso2 : string
Return values
CustomerCountryInterface —findCountryByName()
Find country by name.
public
findCountryByName(string $p_countryName) : CustomerCountryInterface
Parameters
- $p_countryName : string
Return values
CustomerCountryInterface —findCountryZoneByNameAndCountry()
This method returns a CustomerCountryZone object if found. Otherwise null will be returned.
public
findCountryZoneByNameAndCountry(CustomerCountryZoneNameInterface|string $p_zoneName, CustomerCountryInterface $customerCountry) : CustomerCountryZoneInterface|null
Parameters
- $p_zoneName : CustomerCountryZoneNameInterface|string
- $customerCountry : CustomerCountryInterface
Return values
CustomerCountryZoneInterface|null —findCountryZoneByZoneCodeAndCountry()
Finds the country zone by the given zone code and country.
public
findCountryZoneByZoneCodeAndCountry(CustomerCountryZoneIsoCode $zoneCode, CustomerCountryInterface $country) : CustomerCountryZoneInterface|null
Null will be returned if no results are found.
Parameters
- $zoneCode : CustomerCountryZoneIsoCode
-
Zone code of expected country zone.
- $country : CustomerCountryInterface
-
Country of zone.
Return values
CustomerCountryZoneInterface|null —Country zone model, if found.
findCountryZoneByZoneCodeAndCountryId()
Returns the country zone by the given zone code and country id.
public
findCountryZoneByZoneCodeAndCountryId(CustomerCountryZoneIsoCode $zoneCode, IdType $countryId) : CustomerCountryZoneInterface
Null will be returned if no results are found.
Parameters
- $zoneCode : CustomerCountryZoneIsoCode
-
Zone code of expected country zone.
- $countryId : IdType
-
Country id of zone.
Return values
CustomerCountryZoneInterface —Country zone model, if found.
findCountryZonesByCountryId()
This method will return an array of CustomerCountryZone objects found by the country ID. If the country has no zones, an empty array will be returned
public
findCountryZonesByCountryId(IdType $countryId) : array<string|int, mixed>
Parameters
- $countryId : IdType
Return values
array<string|int, mixed> —of CustomerCountryZone objects
getCountries()
Method to get all countries
public
getCountries() : CustomerCountryCollection
Return values
CustomerCountryCollection —getCountryById()
Method to get a country with a given id
public
getCountryById(IdType $id) : CustomerCountryInterface
Parameters
- $id : IdType
Return values
CustomerCountryInterface —getCountryByIso2()
Get country by iso2 code.
public
getCountryByIso2(string $p_countryIso2) : CustomerCountryInterface
Parameters
- $p_countryIso2 : string
Return values
CustomerCountryInterface —getCountryByName()
Get country by name.
public
getCountryByName(string $p_countryName) : CustomerCountryInterface
Parameters
- $p_countryName : string
Return values
CustomerCountryInterface —getCountryZoneByNameAndCountry()
Method to get a country with a given name and country
public
getCountryZoneByNameAndCountry(CustomerCountryZoneNameInterface|string $p_zoneName, CustomerCountryInterface $customerCountry) : CustomerCountryZoneInterface
Parameters
- $p_zoneName : CustomerCountryZoneNameInterface|string
- $customerCountry : CustomerCountryInterface
Return values
CustomerCountryZoneInterface —getCountryZoneByZoneCodeAndCountry()
Returns the country zone by the given zone code and country.
public
getCountryZoneByZoneCodeAndCountry(CustomerCountryZoneIsoCode $zoneCode, CustomerCountryInterface $country) : CustomerCountryZoneInterface
An error will be raised if no results are found.
Parameters
- $zoneCode : CustomerCountryZoneIsoCode
-
Zone code of expected country zone.
- $country : CustomerCountryInterface
-
Country of zone.
Return values
CustomerCountryZoneInterface —Country zone model.
getCountryZoneByZoneCodeAndCountryId()
Returns the country zone by the given zone code and country id.
public
getCountryZoneByZoneCodeAndCountryId(CustomerCountryZoneIsoCode $zoneCode, IdType $countryId) : CustomerCountryZoneInterface
An error will be raised if no results are found.
Parameters
- $zoneCode : CustomerCountryZoneIsoCode
-
Zone code of expected country zone.
- $countryId : IdType
-
Country id of zone.
Return values
CustomerCountryZoneInterface —Country zone model.
getUnknownCountryZoneByName()
This method will return a new CustomerCountryZone object representing an unknown country zone.
public
getUnknownCountryZoneByName(string $p_zoneName) : CustomerCountryZone
Parameters
- $p_zoneName : string
Return values
CustomerCountryZone —isStateMandatory()
This method returns whether the specified country, necessary, needs a state.
public
isStateMandatory(IdType $countryId) : bool
Parameters
- $countryId : IdType