CustomerReader
in package
Class CustomerReader
Table of Contents
- $connection : Connection
- __construct() : mixed
- createQuery() : QueryBuilder
- emailAddressIsAlreadyTaken() : bool
- getCustomerById() : array<string|int, mixed>
- Returns a specific customer based on the given ID.
- getCustomers() : array<string|int, mixed>
- getCustomerTotalCount() : int
- getFilteredCustomers() : array<string|int, mixed>
- getSearchedCustomerTotalCount() : int
- searchCustomers() : array<string|int, mixed>
- Returns a paginated collection of customers based on the given search term and sorting arguments.
Properties
$connection
private
Connection
$connection
Methods
__construct()
public
__construct(Connection $connection) : mixed
Parameters
- $connection : Connection
Return values
mixed —createQuery()
public
createQuery() : QueryBuilder
Return values
QueryBuilder —emailAddressIsAlreadyTaken()
public
emailAddressIsAlreadyTaken(string $email) : bool
Parameters
- $email : string
Return values
bool —getCustomerById()
Returns a specific customer based on the given ID.
public
getCustomerById(CustomerId $id) : array<string|int, mixed>
Parameters
- $id : CustomerId
Tags
Return values
array<string|int, mixed> —getCustomers()
public
getCustomers([bool $areGuestAccounts = false ]) : array<string|int, mixed>
Parameters
- $areGuestAccounts : bool = false
Return values
array<string|int, mixed> —getCustomerTotalCount()
public
getCustomerTotalCount(CustomerFilters $filters) : int
Parameters
- $filters : CustomerFilters
Return values
int —getFilteredCustomers()
public
getFilteredCustomers(CustomerFilters $filters, CustomerSorting $sorting, Pagination|SqlPagination $pagination) : array<string|int, mixed>
Parameters
- $filters : CustomerFilters
- $sorting : CustomerSorting
- $pagination : Pagination|SqlPagination
Return values
array<string|int, mixed> —getSearchedCustomerTotalCount()
public
getSearchedCustomerTotalCount(CustomerSearch|CustomerSearch $search) : int
Parameters
- $search : CustomerSearch|CustomerSearch
Return values
int —searchCustomers()
Returns a paginated collection of customers based on the given search term and sorting arguments.
public
searchCustomers(CustomerSearch|CustomerSearch $searchTerm, CustomerSorting $sorting, Pagination|SqlPagination $pagination) : array<string|int, mixed>
The sorting must be a comma-separated list of attributes. A - can be used to change the order to descending.
Parameters
- $searchTerm : CustomerSearch|CustomerSearch
- $sorting : CustomerSorting
- $pagination : Pagination|SqlPagination