CustomerRepository

Implements \CustomerRepositoryInterface

Class CustomerRepository

This class contains basic methods for finding, creating and deleting customer data

category

System

package

Customer

implements

CustomerRepositoryInterface

Methods

Constructor of the class CustomerRepository.

__construct(\CustomerWriterInterface $customerWriter, \CustomerReaderInterface $customerReader, \CustomerDeleterInterface $customerDeleter, \CustomerAddressRepositoryInterface $customerAddressRepository, \AbstractCustomerFactory $customerFactory, \AddonValueServiceInterface $addonValueService) 

Arguments

$customerWriter

\CustomerWriterInterface

Customer writer.

$customerReader

\CustomerReaderInterface

Customer reader.

$customerDeleter

\CustomerDeleterInterface

Customer deleter.

$customerAddressRepository

\CustomerAddressRepositoryInterface

Customer address repository.

$customerFactory

\AbstractCustomerFactory

Customer factory.

$addonValueService

\AddonValueServiceInterface

Service to handle customer addon values.

Deletes the customer by the ID.

deleteCustomerById(\IdType $customerId) 

Arguments

$customerId

\IdType

Customer's ID.

Deletes a guest account by its email address.

deleteGuestByEmail(\CustomerEmailInterface $email) 

Arguments

$email

\CustomerEmailInterface

Guest customer's E-Mail address.

Filters customer records and returns an array with results.

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

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

Arguments

$conditions

array

Associative array containing the desired field and value.

$limit

integer

Result limit

$offset

integer

Result offset

Response

array

Returns an array that contains customer objects.

Finds customer data by an ID.

getCustomerById(\IdType $customerId) : \CustomerInterface
Throws
\InvalidArgumentException

If customer has been not found.

Arguments

$customerId

\IdType

Customer's ID.

Response

\CustomerInterface

Filters customer records and returns the total count.

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

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

Arguments

$conditions

array

Associative array containing the desired field and value.

Response

integer

Returns a guest account by its email address.

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

Arguments

$email

\CustomerEmailInterface

Guest customer's E-Mail address.

Response

\Customer|null

Customer or null if not found.

Creates a new customer.

getNewCustomer() : \Customer

Response

\Customer

Newly created customer.

Finds a registered customer based on the e-mail address.

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

Arguments

$email

\CustomerEmailInterface

Customer's E-Mail address.

Response

\Customer|null

Customer or null if not found.

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.

Stores customer data in the database.

store(\CustomerInterface $customer) 

Arguments

$customer

\CustomerInterface

Customer.

Properties

Customer writer.

customerWriter : \CustomerWriterInterface

Customer reader.

customerReader : \CustomerReaderInterface

Customer deleter.

customerDeleter : \CustomerDeleterInterface

Customer address repository.

customerAddressRepository : \CustomerAddressRepositoryInterface

Customer factory.

customerFactory : \AbstractCustomerFactory

addonValueService

addonValueService : \AddonValueServiceInterface