CustomerCountryReader
in package
implements
CustomerCountryReaderInterface
Class CustomerCountryReader
This class is used for reading customer country data from the database
Tags
Interfaces, Classes and Traits
- CustomerCountryReaderInterface
- Interface CustomerCountryReaderInterface
Table of Contents
- $customerFactory : AbstractCustomerFactory
- $db : CI_DB_query_builder
- __construct() : mixed
- Constructor of the class CustomerCountryReader
- findById() : CustomerCountry|null
- Method to find a country with a given ID if it exists else it will return null
- findByIso2() : CustomerCountry|null
- Method to find a country with a given iso2 code if it exists else it will return null
- findByName() : CustomerCountry|null
- Method to find a country with a given name if it exists else it will return null
- getAll() : CustomerCountryCollection
- Method to get all countries
- isStateMandatory() : bool
- This method returns whether the specified country, necessary, needs a state.
- _getCountryByArray() : CustomerCountry
Properties
$customerFactory
protected
AbstractCustomerFactory
$customerFactory
$db
protected
CI_DB_query_builder
$db
Methods
__construct()
Constructor of the class CustomerCountryReader
public
__construct(AbstractCustomerFactory $customerFactory, CI_DB_query_builder $dbQueryBuilder) : mixed
Parameters
- $customerFactory : AbstractCustomerFactory
- $dbQueryBuilder : CI_DB_query_builder
Return values
mixed —findById()
Method to find a country with a given ID if it exists else it will return null
public
findById(IdType $countryId) : CustomerCountry|null
Parameters
- $countryId : IdType
Return values
CustomerCountry|null —findByIso2()
Method to find a country with a given iso2 code if it exists else it will return null
public
findByIso2( $countryIso2) : CustomerCountry|null
Parameters
Return values
CustomerCountry|null —findByName()
Method to find a country with a given name if it exists else it will return null
public
findByName( $countryName) : CustomerCountry|null
Parameters
Return values
CustomerCountry|null —getAll()
Method to get all countries
public
getAll() : CustomerCountryCollection
Return values
CustomerCountryCollection —isStateMandatory()
This method returns whether the specified country, necessary, needs a state.
public
isStateMandatory(IdType $countryId) : bool
Parameters
- $countryId : IdType
Return values
bool —_getCountryByArray()
protected
_getCountryByArray( $countryDataArray) : CustomerCountry