CountryService

Implements \CountryServiceInterface

Class CountryService

This class is used for finding country data

category

System

package

Customer

subpackage

Country

implements

CountryServiceInterface

Methods

Constructor of the class CountryService

__construct(\CustomerCountryRepositoryInterface $customerCountryRepo, \CustomerCountryZoneRepositoryInterface $customerCountryZoneRepo) 

Arguments

$customerCountryZoneRepo

\CustomerCountryZoneRepositoryInterface

Checks if country has country zones

countryHasCountryZones(\CustomerCountryInterface $customerCountry) : boolean

Arguments

$customerCountry

\CustomerCountryInterface

Response

boolean

true|false if there are|are not country zones

Checks if there is a country zone in a country

countryZoneExistsInCountry(\CustomerCountryZoneInterface $customerCountryZone, \CustomerCountryInterface $customerCountry) : boolean

Arguments

$customerCountryZone

\CustomerCountryZoneInterface

$customerCountry

\CustomerCountryInterface

Response

boolean

true|false if country zone exists|not exists

Find country by iso2 code.

findCountryByIso2(string $p_countryIso2) : \CustomerCountryInterface|null

Arguments

$p_countryIso2

string

Response

\CustomerCountryInterface|null

Find country by name.

findCountryByName(string $p_countryName) : \CustomerCountryInterface

Arguments

$p_countryName

string

Response

\CustomerCountryInterface

This method returns a CustomerCountryZone object if found. Otherwise null will be returned.

findCountryZoneByNameAndCountry(\CustomerCountryZoneNameInterface|string $p_zoneName, \CustomerCountryInterface $customerCountry) : \CustomerCountryZoneInterface|null

Arguments

$customerCountry

\CustomerCountryInterface

Response

\CustomerCountryZoneInterface|null

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

findCountryZonesByCountryId(\IdType $countryId) : array

Arguments

$countryId

\IdType

Response

array

of CustomerCountryZone objects

Getter method for the country ID

getCountryById(\IdType $id) : \CustomerCountryInterface

Arguments

$id

\IdType

Response

\CustomerCountryInterface

Get country by iso2 code.

getCountryByIso2(string $p_countryIso2) : \CustomerCountryInterface

Arguments

$p_countryIso2

string

Response

\CustomerCountryInterface

Get country by name.

getCountryByName(string $p_countryName) : \CustomerCountryInterface

Arguments

$p_countryName

string

Response

\CustomerCountryInterface

getCountryZoneById

getCountryZoneById(\IdType $id) : \CustomerCountryZoneInterface

Arguments

$id

\IdType

Response

\CustomerCountryZoneInterface

Getter method for the country zone

getCountryZoneByNameAndCountry(\CustomerCountryZoneNameInterface|string $p_zoneName, \CustomerCountryInterface $customerCountry) : \CustomerCountryZoneInterface

Arguments

$customerCountry

\CustomerCountryInterface

Response

\CustomerCountryZoneInterface

This method will return a new CustomerCountryZone object representing an unknown country zone.

getUnknownCountryZoneByName(string $p_zoneName) : \CustomerCountryZone

Arguments

$p_zoneName

string

Response

\CustomerCountryZone

Properties

customerCountryRepo

customerCountryRepo : \CustomerCountryRepositoryInterface

customerCountryZoneRepo

customerCountryZoneRepo : \CustomerCountryZoneRepositoryInterface