CustomerCountryRepository

Implements \CustomerCountryRepositoryInterface

Class CustomerCountryRepository

This class provides basic methods for finding customer country data

category

System

package

Customer

subpackage

Country

implements

CustomerCountryRepositoryInterface

Methods

Constructor of the class CustomerCountryRepository

__construct(\CustomerCountryReader $customerCountryReader) 

Arguments

$customerCountryReader

\CustomerCountryReader

This method will get a country if it exists else it will return null.

findById(\IdType $countryId) : \CustomerCountryInterface

Arguments

$countryId

\IdType

Response

\CustomerCountryInterface

Find country by iso2 code.

findByIso2(\CustomerCountryIso2Interface $countryIso2) : \CustomerCountryInterface|null

Arguments

Response

\CustomerCountryInterface|null

Find country by name.

findByName(\CustomerCountryNameInterface $countryName) : \CustomerCountryInterface

Method to get a customer country with a given country ID

getById(\IdType $countryId) : \CustomerCountry
Throws
\Exception

if country not found

Arguments

$countryId

\IdType

Response

\CustomerCountry

Get country by iso2 code.

getByIso2(\CustomerCountryIso2Interface $countryIso2) : \CustomerCountry
Throws
\Exception

If the country could not be found.

Arguments

Response

\CustomerCountry

Get country by name.

getByName(\CustomerCountryNameInterface $countryName) : \CustomerCountry
Throws
\Exception

If the country could not be found.

Arguments

Response

\CustomerCountry

This method returns whether the specified country, necessary, needs a state.

isStateMandatory(\IdType $countryId) : boolean

Arguments

$countryId

\IdType

Response

boolean

Properties

customerCountryReader

customerCountryReader : \CustomerCountryReaderInterface