CustomerCountryZoneRepository

Implements \CustomerCountryZoneRepositoryInterface

Class CustomerCountryZoneRepository

This class provides basic methods for finding customer country zone data

category

System

package

Customer

subpackage

CountryZone

implements

CustomerCountryZoneRepositoryInterface

Methods

Constructor of the class CustomerCountryZoneRepository

__construct(\CustomerCountryZoneReaderInterface $customerCountryZoneReader, \AbstractCustomerFactory $customerFactory) 

Arguments

$customerCountryZoneReader

\CustomerCountryZoneReaderInterface

$customerFactory

\AbstractCustomerFactory

This method will get the country zone by its ID if it exists, if not it will return null.

findById(\IdType $countryZoneId) : \CustomerCountryZone|null

Arguments

$countryZoneId

\IdType

Response

\CustomerCountryZone|null

This method will get the country zone by its name and country if it exists, if not it will return null.

findByNameAndCountry(\CustomerCountryZoneNameInterface $countryZoneName, \CustomerCountryInterface $country) : \CustomerCountryZone|null

Arguments

Response

\CustomerCountryZone|null

Finds the country zone by the given zone code and country.

findCountryZoneByZoneCodeAndCountry(\CustomerCountryZoneIsoCodeInterface $zoneCode, \CustomerCountryInterface $country) : \CustomerCountryZoneInterface|null

Null will be returned if no results are found.

Arguments

$zoneCode

\CustomerCountryZoneIsoCodeInterface

Zone code of expected country zone.

$country

\CustomerCountryInterface

Country of zone.

Response

\CustomerCountryZoneInterface|null

Returns the country zone by the given zone code and country id.

findCountryZoneByZoneCodeAndCountryId(\CustomerCountryZoneIsoCodeInterface $zoneCode, \IdType $countryId) : \CustomerCountryZoneInterface

Null will be returned if no results are found.

Arguments

$zoneCode

\CustomerCountryZoneIsoCodeInterface

Zone code of expected country zone.

$countryId

\IdType

Country id of zone.

Response

\CustomerCountryZoneInterface

This method will return an array of country zones found by the country ID.

findCountryZonesByCountryId(\IdType $countryId) : array

Arguments

$countryId

\IdType

Response

array

Method to get a country zone with a given ID

getById(\IdType $countryZoneId) : \CustomerCountryZoneInterface
Throws
\Exception

if country zone not found

Arguments

$countryZoneId

\IdType

Response

\CustomerCountryZoneInterface

Method to get a county zone with a given name and country

getByNameAndCountry(\CustomerCountryZoneNameInterface $countryZoneName, \CustomerCountryInterface $country) : \CustomerCountryZoneInterface
Throws
\Exception

if country zone not found

Arguments

Response

\CustomerCountryZoneInterface

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

getUnknownCountryZoneByName(\CustomerCountryZoneNameInterface $countryZoneName) : \CustomerCountryZone

ID is 0 and ISO code is empty.

Arguments

Response

\CustomerCountryZone

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

isStateMandatory(\IdType $countryId) : boolean

Arguments

$countryId

\IdType

Response

boolean

Properties

customerCountryZoneReader

customerCountryZoneReader : \CustomerCountryZoneReaderInterface

customerFactory

customerFactory : \AbstractCustomerFactory