CustomerReader

Extends \AbstractDataPaginator Implements \CustomerReaderInterface

Class CustomerReader

This class is used for reading customer data from the database

category

System

package

Customer

implements

CustomerReaderInterface

Methods

ManufacturerReader constructor.

__construct(\CI_DB_query_builder $query_builder) 
inherited

Arguments

$query_builder

\CI_DB_query_builder

Translate an order by sql instruction into a array of Sorter

_translateOrderByStringIntoArrayOfSorter(\StringType|null $orderBy = null) : array
inherited

Arguments

$orderBy

\StringType|null

SQL instruction with fields to sort.

Response

array

of Sorter objects.

Filters customer records and returns an array with results.

filterCustomers(array $conditions = array(), \Pager|null $pager = null, array $sorters = array()) : array

Example: $repository->filterCustomers('customers_id' => 1);

Arguments

$conditions

array

Associative array containing the desired field and value.

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

array

Returns an array that contains customer objects.

Finds a customer by the given ID.

findById(\IdType $id) : \Customer|null

Arguments

$id

\IdType

Customer's ID.

Response

\Customer|null

Customer or null if not found.

Finds a guest by email address.

findGuestByEmail(\CustomerEmailInterface $email) : \Customer|null

Arguments

$email

\CustomerEmailInterface

Customer's E-Mail address.

Response

\Customer|null

Customer or null if not found.

Finds a registree by email address.

findRegistreeByEmail(\CustomerEmailInterface $email) : \Customer|null

Arguments

$email

\CustomerEmailInterface

Customer's E-Mail address.

Response

\Customer|null

Customer or null if not found.

Filters customer records and returns the total count.

getFilterCustomersCount(array $conditions = array()) : integer

Example: $reader->filterCustomers( array('customers_id' => 1) );

Arguments

$conditions

array

Associative array containing the desired field and value.

Response

integer

Returns the total customers count.

Filters customer records by a given CustomerSearchCondition object and returns an array with results.

searchCustomers(\CustomerSearchCondition $condition, \Pager|null $pager = null, array $sorters = array()) : array

Arguments

$condition

\CustomerSearchCondition

Conditions object for search.

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

array

Returns an array that contains customer objects.

Properties