CustomerReadService

Implements \CustomerReadServiceInterface

Class CustomerReadService

This class provides methods for reading customer data.

category

System

package

Customer

implements

CustomerReadServiceInterface

Methods

Constructor of the class CustomerService.

__construct(\CustomerRepositoryInterface $customerRepository) 

Arguments

$customerRepository

\CustomerRepositoryInterface

Customer repository.

Checks if address is the default address of the customer.

addressIsDefaultCustomerAddress(\CustomerAddressInterface $customerAddress) : boolean

Arguments

$customerAddress

\CustomerAddressInterface

Customer's address.

Response

boolean

Is provided address the customer's default address?

Filters customer records and returns an array with results.

filterCustomers(array $conditions = array(), integer $limit = null, integer $offset = null) : array

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

Arguments

$conditions

array

Associative array containing the desired field and value.

$limit

integer

MySQL limit applied to the records.

$offset

integer

MySQL offset applied to the records.

Response

array

Returns an array that contains customer objects.

Finds a customer by its email address. Returns null if no customer is found.

findCustomerByEmail(\CustomerEmailInterface $emailAddress) : \Customer|null

Arguments

$emailAddress

\CustomerEmailInterface

Response

\Customer|null

Finds a customer by an entered ID.

getCustomerById(\IdType $customerId) : \Customer

Arguments

$customerId

\IdType

Customer ID.

Response

\Customer

Customer.

Filters customer records and returns the total count.

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

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

Arguments

$conditions

array

Associative array containing the desired field and value.

Response

integer

Checks if the email address of the registree already exists.

registreeEmailExists(\CustomerEmailInterface $email) : boolean

Arguments

$email

\CustomerEmailInterface

Customer's E-Mail address.

Response

boolean

Does the E-Mail address already exist?

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

searchCustomers(\CustomerSearchCondition $condition, \Pager $pager) : array

Arguments

$condition

\CustomerSearchCondition

Conditions object for search.

$pager

\Pager

Pager object with page settings to split the results into several pages.

Response

array

Returns an array that contains customer objects.

Properties

Customer repository.

customerRepository : \CustomerRepositoryInterface