CustomerRepository
in
Interface CustomerRepository
Table of Contents
- deleteCustomers() : void
- Deletes customers based on the given customer IDs.
- deleteOutdatedGuestAccounts() : void
- Deletes all outdated guests customers (the ones without an active session).
- 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
Methods
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
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
The filters must be a map, that assigns an attribute its filtering pattern.
The sorting must be a comma-separated list of attributes. A - can be used to change the order to descending.
Parameters
- $filters : CustomerFilters
- $sorting : CustomerSorting
- $pagination : Pagination
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
Return values
Customers —getCustomersTotalCount()
Returns total count of customers based on the given filter arguments.
public
getCustomersTotalCount(CustomerFilters $filters) : int
The filters must be a map, that assigns an attribute it's filtering pattern.
Parameters
- $filters : CustomerFilters
Return values
int —getGuestAccounts()
Returns all available customers that are guest accounts.
public
getGuestAccounts() : Customers
Return values
Customers —getSearchedCustomerTotalCount()
Returns total count of customers based on the given search object.
public
getSearchedCustomerTotalCount(CustomerSearch $searchTerm) : int
Parameters
- $searchTerm : CustomerSearch
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
The sorting must be a comma-separated list of attributes. A - can be used to change the order to descending.
Parameters
- $searchTerm : CustomerSearch
- $sorting : CustomerSorting
- $pagination : Pagination
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