CustomerCountryZoneRepository
in package
implements
CustomerCountryZoneRepositoryInterface
Class CustomerCountryZoneRepository
This class provides basic methods for finding customer country zone data
Tags
Interfaces, Classes and Traits
- CustomerCountryZoneRepositoryInterface
- Interface CustomerCountryZoneRepositoryInterface
Table of Contents
- $customerCountryZoneReader : CustomerCountryZoneReaderInterface
- $customerFactory : AbstractCustomerFactory
- __construct() : mixed
- Constructor of the class CustomerCountryZoneRepository
- findById() : CustomerCountryZone|null
- This method will get the country zone by its ID if it exists, if not it will return null.
- findByNameAndCountry() : CustomerCountryZone|null
- This method will get the country zone by its name and country if it exists, if not it will return null.
- 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 country zones found by the country ID.
- getById() : CustomerCountryZoneInterface
- Method to get a country zone with a given ID
- getByNameAndCountry() : CustomerCountryZoneInterface
- Method to get a county zone with a given name and country
- 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.
Properties
$customerCountryZoneReader
protected
CustomerCountryZoneReaderInterface
$customerCountryZoneReader
$customerFactory
protected
AbstractCustomerFactory
$customerFactory
Methods
__construct()
Constructor of the class CustomerCountryZoneRepository
public
__construct(CustomerCountryZoneReaderInterface $customerCountryZoneReader, AbstractCustomerFactory $customerFactory) : mixed
Parameters
- $customerCountryZoneReader : CustomerCountryZoneReaderInterface
- $customerFactory : AbstractCustomerFactory
Return values
mixed —findById()
This method will get the country zone by its ID if it exists, if not it will return null.
public
findById(IdType $countryZoneId) : CustomerCountryZone|null
Parameters
- $countryZoneId : IdType
Return values
CustomerCountryZone|null —findByNameAndCountry()
This method will get the country zone by its name and country if it exists, if not it will return null.
public
findByNameAndCountry(CustomerCountryZoneNameInterface $countryZoneName, CustomerCountryInterface $country) : CustomerCountryZone|null
Parameters
- $countryZoneName : CustomerCountryZoneNameInterface
- $country : CustomerCountryInterface
Return values
CustomerCountryZone|null —findCountryZoneByZoneCodeAndCountry()
Finds the country zone by the given zone code and country.
public
findCountryZoneByZoneCodeAndCountry(CustomerCountryZoneIsoCodeInterface $zoneCode, CustomerCountryInterface $country) : CustomerCountryZoneInterface|null
Null will be returned if no results are found.
Parameters
- $zoneCode : CustomerCountryZoneIsoCodeInterface
-
Zone code of expected country zone.
- $country : CustomerCountryInterface
-
Country of zone.
Return values
CustomerCountryZoneInterface|null —findCountryZoneByZoneCodeAndCountryId()
Returns the country zone by the given zone code and country id.
public
findCountryZoneByZoneCodeAndCountryId(CustomerCountryZoneIsoCodeInterface $zoneCode, IdType $countryId) : CustomerCountryZoneInterface
Null will be returned if no results are found.
Parameters
- $zoneCode : CustomerCountryZoneIsoCodeInterface
-
Zone code of expected country zone.
- $countryId : IdType
-
Country id of zone.
Return values
CustomerCountryZoneInterface —findCountryZonesByCountryId()
This method will return an array of country zones found by the country ID.
public
findCountryZonesByCountryId(IdType $countryId) : array<string|int, mixed>
Parameters
- $countryId : IdType
Return values
array<string|int, mixed> —getById()
Method to get a country zone with a given ID
public
getById(IdType $countryZoneId) : CustomerCountryZoneInterface
Parameters
- $countryZoneId : IdType
Tags
Return values
CustomerCountryZoneInterface —getByNameAndCountry()
Method to get a county zone with a given name and country
public
getByNameAndCountry(CustomerCountryZoneNameInterface $countryZoneName, CustomerCountryInterface $country) : CustomerCountryZoneInterface
Parameters
- $countryZoneName : CustomerCountryZoneNameInterface
- $country : CustomerCountryInterface
Tags
Return values
CustomerCountryZoneInterface —getUnknownCountryZoneByName()
This method will return a new CustomerCountryZone object representing an unknown country zone.
public
getUnknownCountryZoneByName(CustomerCountryZoneNameInterface $countryZoneName) : CustomerCountryZone
ID is 0 and ISO code is empty.
Parameters
- $countryZoneName : CustomerCountryZoneNameInterface
Return values
CustomerCountryZone —isStateMandatory()
This method returns whether the specified country, necessary, needs a state.
public
isStateMandatory(IdType $countryId) : bool
Parameters
- $countryId : IdType