Class CustomerReader
This class is used for reading customer data from the database
| category |
System |
|---|---|
| package |
Customer |
| implements |
CustomerReaderInterface |
__construct(\CI_DB_query_builder $query_builder)
\CI_DB_query_builder
_applyDefaultSorting()
_applyPagination(\Pager|null $pager = null) : $this|\ProductListProvider
_applySorting(array $sorters = array()) : $this|\ProductListProvider
| Throws |
|
|---|
arrayArray of Sorter objects.
$this|\ProductListProviderSame instance for chained method calls.
_createCustomerByArray(array $customerDataArray) : \Customer
| todo |
If date of birth is null in the database then: $customerDataArray['customers_dob'] = '0000-00-00 00:00:00' and then the getDateOfBirth() will return wrong results ($customer->getDateOfBirth() >> -0001-11-30 00:00:00). |
|---|
arrayCustomer data.
\Customer$customer Created customer.
_findByFilter(array $filterArray) : \Customer|null
_getFieldMap() : \array.
\array.
_parseOrderByString(\StringType|null $orderBy = null) : array
arraywith sort information structured as ['field'=>'', 'direction'=>''].
_translateOrderByStringIntoArrayOfSorter(\StringType|null $orderBy = null) : array
arrayof Sorter objects.
_translateToDatabaseField(\string $fieldName) : \string.
| Throws |
|
|---|
\stringObject Field name.
\string.
_translateToJsonFieldName(\StringType $databaseFieldName) : string|FALSE
\StringTypethe database field name. It can be supplied as table.fieldName or fieldName.
string|FALSEwill return the field name or FALSE if the field doesn't exist.
filterCustomers(array $conditions = array(), \Pager|null $pager = null, array $sorters = array()) : array
Example: $repository->filterCustomers('customers_id' => 1);
arrayAssociative array containing the desired field and value.
array(Optional) array of Sorter objects with data sorting information
arrayReturns an array that contains customer objects.
findById(\IdType $id) : \Customer|null
findGuestByEmail(\CustomerEmailInterface $email) : \Customer|null
findRegistreeByEmail(\CustomerEmailInterface $email) : \Customer|null
getFilterCustomersCount(array $conditions = array()) : integer
Example: $reader->filterCustomers( array('customers_id' => 1) );
arrayAssociative array containing the desired field and value.
integerReturns the total customers count.
searchCustomers(\CustomerSearchCondition $condition, \Pager|null $pager = null, array $sorters = array()) : array
array(Optional) array of Sorter objects with data sorting information
arrayReturns an array that contains customer objects.
customerAddressRepository : \CustomerAddressRepositoryInterface
isGuest : boolean
| var |
|---|
boolean
db : \\CI_DB_query_builder
| var |
|---|
\\CI_DB_query_builder