phpDocumentor

CustomerRepository
in package
implements CustomerRepositoryInterface

Class CustomerRepository

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

Tags
category

System

implements

CustomerRepositoryInterface

Interfaces, Classes and Traits

CustomerRepositoryInterface
Interface CustomerRepositoryInterface

Table of Contents

$addonValueService  : AddonValueServiceInterface
$customerAddressRepository  : CustomerAddressRepositoryInterface
Customer address repository.
$customerDeleter  : CustomerDeleterInterface
Customer deleter.
$customerFactory  : AbstractCustomerFactory
Customer factory.
$customerReader  : CustomerReaderInterface
Customer reader.
$customerWriter  : CustomerWriterInterface
Customer writer.
__construct()  : mixed
Constructor of the class CustomerRepository.
deleteCustomerById()  : mixed
Deletes the customer by the ID.
deleteGuestByEmail()  : mixed
Deletes a guest account by its email address.
filterCustomers()  : array<string|int, mixed>
Filters customer records and returns an array with results.
getCustomerById()  : CustomerInterface
Finds customer data by an ID.
getFilterCustomersCount()  : int
Filters customer records and returns the total count.
getGuestByEmail()  : Customer|null
Returns a guest account by its email address.
getNewCustomer()  : Customer
Creates a new customer.
getRegistreeByEmail()  : Customer|null
Finds a registered customer based on the e-mail address.
searchCustomers()  : array<string|int, mixed>
Filters customer records by a given CustomerSearchCondition object and returns an array with results.
store()  : mixed
Stores customer data in the database.

Properties

Methods

__construct()

Constructor of the class CustomerRepository.

public __construct(CustomerWriterInterface $customerWriter, CustomerReaderInterface $customerReader, CustomerDeleterInterface $customerDeleter, CustomerAddressRepositoryInterface $customerAddressRepository, AbstractCustomerFactory $customerFactory, AddonValueServiceInterface $addonValueService) : mixed
Parameters
$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.

Return values
mixed

deleteCustomerById()

Deletes the customer by the ID.

public deleteCustomerById(IdType $customerId) : mixed
Parameters
$customerId : IdType

Customer's ID.

Return values
mixed

filterCustomers()

Filters customer records and returns an array with results.

public filterCustomers([array<string|int, mixed> $conditions = [] ][, Pager|null $pager = null ][, array<string|int, mixed> $sorters = [] ]) : array<string|int, mixed>

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

Parameters
$conditions : array<string|int, mixed> = []

Associative array containing the desired field and value.

$pager : Pager|null = null

(Optional) Pager object with pagination information

$sorters : array<string|int, mixed> = []

(Optional) array of Sorter objects with data sorting information

Return values
array<string|int, mixed>

Returns an array that contains customer objects.

getFilterCustomersCount()

Filters customer records and returns the total count.

public getFilterCustomersCount([array<string|int, mixed> $conditions = [] ]) : int

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

Parameters
$conditions : array<string|int, mixed> = []

Associative array containing the desired field and value.

Return values
int

searchCustomers()

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

public searchCustomers(CustomerSearchCondition $condition[, Pager|null $pager = null ][, array<string|int, mixed> $sorters = [] ]) : array<string|int, mixed>
Parameters
$condition : CustomerSearchCondition

Conditions object for search.

$pager : Pager|null = null

(Optional) Pager object with pagination information

$sorters : array<string|int, mixed> = []

(Optional) array of Sorter objects with data sorting information

Return values
array<string|int, mixed>

Returns an array that contains customer objects.

Search results