CustomerRepository
extends AbstractEventDispatchingRepository
in package
implements
CustomerRepository
Class CustomerRepository
Interfaces, Classes and Traits
- CustomerRepository
- Interface CustomerRepository
Table of Contents
- $eventDispatcher : EventDispatcherInterface
- $mapper : CustomerMapper
- $reader : CustomerReader
- $writer : CustomerWriter
- __construct() : mixed
- createCustomer() : CustomerId
- createGuestAccount() : CustomerId
- createMultipleCustomers() : CustomerIds
- createMultipleGuestAccounts() : CustomerIds
- deleteCustomers() : void
- Deletes customers based on the given customer IDs.
- deleteOutdatedGuestAccounts() : void
- Deletes all outdated guests customers (the ones without an active session).
- dispatchEntityEvents() : void
- dispatchEvent() : void
- filterCustomers() : Customers
- Returns a filtered and paginated collection of customers based on the given filter and sorting arguments.
- getCustomerById() : Customer
- Returns a specific customer based on the given ID.
- getCustomers() : Customers
- Returns all available customers.
- getCustomersTotalCount() : int
- Returns total count of customers based on the given filter arguments.
- getGuestAccounts() : Customers
- Returns all available customers that are guest accounts.
- getSearchedCustomerTotalCount() : int
- Returns total count of customers based on the given search object.
- searchCustomers() : Customers
- Returns a paginated collection of customers based on the given search term and sorting arguments.
- storeCustomers() : void
- Stores multiple customers.
- validateEmailAddress() : true
- Checks if an email address is valid in its self or is already taken by another customer
- setEventDispatcher() : void
Properties
$eventDispatcher
private
EventDispatcherInterface
$eventDispatcher
$mapper
private
CustomerMapper
$mapper
$reader
private
CustomerReader
$reader
$writer
private
CustomerWriter
$writer
Methods
__construct()
public
__construct(CustomerMapper $mapper, CustomerReader $reader, CustomerWriter $writer, EventDispatcherInterface $dispatcher) : mixed
Parameters
- $mapper : CustomerMapper
- $reader : CustomerReader
- $writer : CustomerWriter
- $dispatcher : EventDispatcherInterface
Return values
mixed —createCustomer()
public
createCustomer(CustomerGroup $customerGroup, PersonalInformation $personalInformation, BusinessInformation $businessInformation, ContactInformation $contactInformation, CustomerCredit $credit[, bool $isFavorite = false ]) : CustomerId
Parameters
- $customerGroup : CustomerGroup
- $personalInformation : PersonalInformation
- $businessInformation : BusinessInformation
- $contactInformation : ContactInformation
- $credit : CustomerCredit
- $isFavorite : bool = false
Tags
Return values
CustomerId —createGuestAccount()
public
createGuestAccount(CustomerGroup $customerGroup, PersonalInformation $personalInformation, BusinessInformation $businessInformation, ContactInformation $contactInformation, CustomerCredit $credit[, bool $isFavorite = false ]) : CustomerId
Parameters
- $customerGroup : CustomerGroup
- $personalInformation : PersonalInformation
- $businessInformation : BusinessInformation
- $contactInformation : ContactInformation
- $credit : CustomerCredit
- $isFavorite : bool = false
Tags
Return values
CustomerId —createMultipleCustomers()
public
createMultipleCustomers(array<string|int, mixed> ...$creationArguments) : CustomerIds
Parameters
- $creationArguments : array<string|int, mixed>
Tags
Return values
CustomerIds —createMultipleGuestAccounts()
public
createMultipleGuestAccounts(array<string|int, mixed> ...$creationArguments) : CustomerIds
Parameters
- $creationArguments : array<string|int, mixed>
Tags
Return values
CustomerIds —deleteCustomers()
Deletes customers based on the given customer IDs.
public
deleteCustomers(CustomerId ...$ids) : void
Parameters
- $ids : CustomerId
Tags
Return values
void —deleteOutdatedGuestAccounts()
Deletes all outdated guests customers (the ones without an active session).
public
deleteOutdatedGuestAccounts() : void
Tags
Return values
void —dispatchEntityEvents()
public
dispatchEntityEvents(EventRaisingEntity $entity) : void
Parameters
- $entity : EventRaisingEntity
Tags
Return values
void —dispatchEvent()
public
dispatchEvent(object $event) : void
Parameters
- $event : object
Tags
Return values
void —filterCustomers()
Returns a filtered and paginated collection of customers based on the given filter and sorting arguments.
public
filterCustomers(CustomerFilters $filters, CustomerSorting $sorting, Pagination $pagination) : Customers
Parameters
- $filters : CustomerFilters
- $sorting : CustomerSorting
- $pagination : Pagination
Tags
Return values
Customers —getCustomerById()
Returns a specific customer based on the given ID.
public
getCustomerById(CustomerId $id) : Customer
Parameters
- $id : CustomerId
Tags
Return values
Customer —getCustomers()
Returns all available customers.
public
getCustomers() : Customers
Tags
Return values
Customers —getCustomersTotalCount()
Returns total count of customers based on the given filter arguments.
public
getCustomersTotalCount(CustomerFilters $filters) : int
Parameters
- $filters : CustomerFilters
Tags
Return values
int —getGuestAccounts()
Returns all available customers that are guest accounts.
public
getGuestAccounts() : Customers
Tags
Return values
Customers —getSearchedCustomerTotalCount()
Returns total count of customers based on the given search object.
public
getSearchedCustomerTotalCount(CustomerSearch $searchTerm) : int
Parameters
- $searchTerm : CustomerSearch
Tags
Return values
int —searchCustomers()
Returns a paginated collection of customers based on the given search term and sorting arguments.
public
searchCustomers(CustomerSearch $searchTerm, CustomerSorting $sorting, Pagination $pagination) : Customers
Parameters
- $searchTerm : CustomerSearch
- $sorting : CustomerSorting
- $pagination : Pagination
Tags
Return values
Customers —storeCustomers()
Stores multiple customers.
public
storeCustomers(Customer ...$customers) : void
Parameters
- $customers : Customer
Tags
Return values
void —validateEmailAddress()
Checks if an email address is valid in its self or is already taken by another customer
public
validateEmailAddress(string $email) : true
Parameters
- $email : string
Tags
Return values
true —setEventDispatcher()
protected
setEventDispatcher(EventDispatcherInterface $eventDispatcher) : void
Parameters
- $eventDispatcher : EventDispatcherInterface