CustomerCountryZoneReader

Implements \CustomerCountryZoneReaderInterface

Class CustomerCountryZoneReader

This class is used for reading customer country zone data from the database

category

System

package

Customer

subpackage

CountryZone

implements

CustomerCountryZoneReaderInterface

Methods

Constructor of the class CustomerCountryZoneReader

__construct(\AbstractCustomerFactory $customerFactory, \CI_DB_query_builder $dbQueryBuilder) 

Arguments

$customerFactory

\AbstractCustomerFactory

$dbQueryBuilder

\CI_DB_query_builder

Creates a customer country zone object from the given zone data.

_createCountryZoneByArray(array $zoneDataArray) : \CustomerCountryZone

Arguments

$zoneDataArray

array

Zone data, must contain keys "zone_id", "zone_name" and "zone_code".

Response

\CustomerCountryZone

Fetches data for a zone by the given zone code and country id.

_getZoneDataByZoneCodeAndCountryId(string $zoneCode, integer $countryId) : array

Arguments

$zoneCode

string

ISO code of expected zone.

$countryId

integer

Id of zone's country.

Response

array

Data for a zone.

Method to find a country zone with a given ID if it exists else it will return null

findById(\IdType $countryZoneId) : \CustomerCountryZone

Arguments

$countryZoneId

\IdType

Response

\CustomerCountryZone

Method to find a country zone with a given name if it exists else it will return null

findByName(\CustomerCountryZoneNameInterface $countryZoneName) : \CustomerCountryZone

Arguments

Response

\CustomerCountryZone

findByNameAndCountry

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

Arguments

Response

\CustomerCountryZone|null

Returns an array with country zone data.

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

An empty array 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

Country zone.

Returns an array with country zone data.

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

An empty array 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|null

Country zone.

Method to find a country zone with a given country ID if it exists else it will return an empty array

findCountryZonesByCountryId(\IdType $countryId) : array

Arguments

$countryId

\IdType

Response

array

of CustomerCountryZone objects

Properties

customerFactory

customerFactory : \AbstractCustomerFactory

db

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder