phpDocumentor

CountryService
in package
implements CountryServiceInterface

Class CountryService

This class is used for finding country data

Tags
category

System

subpackage

Country

implements

CountryServiceInterface

Interfaces, Classes and Traits

CountryServiceInterface
Interface CountryServiceInterface

Table of Contents

$customerCountryRepo  : CustomerCountryRepositoryInterface
$customerCountryZoneRepo  : CustomerCountryZoneRepositoryInterface
__construct()  : mixed
Constructor of the class CountryService
countryHasCountryZones()  : bool
Checks if country has country zones
countryZoneExistsInCountry()  : bool
Checks if there is a country zone in a country
findCountryByIso2()  : CustomerCountryInterface|null
Find country by iso2 code.
findCountryByName()  : CustomerCountryInterface
Find country by name.
findCountryZoneByNameAndCountry()  : CustomerCountryZoneInterface|null
This method returns a CustomerCountryZone object if found. Otherwise null will be returned.
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 CustomerCountryZone objects found by the country ID. If the country has no zones, an empty array will be returned
getCountries()  : CustomerCountryCollection
Getter method for all countries
getCountryById()  : CustomerCountryInterface
Getter method for the country ID
getCountryByIso2()  : CustomerCountryInterface
Get country by iso2 code.
getCountryByName()  : CustomerCountryInterface
Get country by name.
getCountryZoneById()  : CustomerCountryZoneInterface
getCountryZoneByNameAndCountry()  : CustomerCountryZoneInterface
Getter method for the country zone
getCountryZoneByZoneCodeAndCountry()  : CustomerCountryZoneInterface
Returns the country zone by the given zone code and country.
getCountryZoneByZoneCodeAndCountryId()  : CustomerCountryZoneInterface
Returns the country zone by the given zone code and country id.
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

Methods

findCountryZoneByZoneCodeAndCountry()

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

public findCountryZoneByZoneCodeAndCountry(CustomerCountryZoneIsoCode $zoneCode, CustomerCountryInterface $country) : CustomerCountryZoneInterface|null

Null will be returned if no results are found.

Parameters
$zoneCode : CustomerCountryZoneIsoCode

Zone code of expected country zone.

$country : CustomerCountryInterface

Country of zone.

Return values
CustomerCountryZoneInterface|null

Country zone model.

findCountryZoneByZoneCodeAndCountryId()

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

public findCountryZoneByZoneCodeAndCountryId(CustomerCountryZoneIsoCode $zoneCode, IdType $countryId) : CustomerCountryZoneInterface

Null will be returned if no results are found.

Parameters
$zoneCode : CustomerCountryZoneIsoCode

Zone code of expected country zone.

$countryId : IdType

Country id of zone.

Return values
CustomerCountryZoneInterface

Country zone model.

findCountryZonesByCountryId()

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

public findCountryZonesByCountryId(IdType $countryId) : array<string|int, mixed>
Parameters
$countryId : IdType
Return values
array<string|int, mixed>

of CustomerCountryZone objects

getCountryZoneByZoneCodeAndCountry()

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

public getCountryZoneByZoneCodeAndCountry(CustomerCountryZoneIsoCode $zoneCode, CustomerCountryInterface $country) : CustomerCountryZoneInterface

An error will be raised if no results are found.

Parameters
$zoneCode : CustomerCountryZoneIsoCode

Zone code of expected country zone.

$country : CustomerCountryInterface

Country of zone.

Tags
throws
CountryZoneNotFoundException

If no results was found by provided arguments.

Return values
CustomerCountryZoneInterface

Country zone model.

getCountryZoneByZoneCodeAndCountryId()

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

public getCountryZoneByZoneCodeAndCountryId(CustomerCountryZoneIsoCode $zoneCode, IdType $countryId) : CustomerCountryZoneInterface

An error will be raised if no results are found.

Parameters
$zoneCode : CustomerCountryZoneIsoCode

Zone code of expected country zone.

$countryId : IdType

Country id of zone.

Tags
throws
CountryZoneNotFoundException

If no results was found by provided arguments.

Return values
CustomerCountryZoneInterface

Country zone model.

getUnknownCountryZoneByName()

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

public getUnknownCountryZoneByName(string $p_zoneName) : CustomerCountryZone
Parameters
$p_zoneName : string
Return values
CustomerCountryZone

isStateMandatory()

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

public isStateMandatory(IdType $countryId) : bool
Parameters
$countryId : IdType
Return values
bool

Search results