TopCustomers ​
- Type
- Class
- Namespace
- craft\commerce\stats
- Inherits
- craft\commerce\stats\TopCustomers » craft\commerce\base\Stat
- Implements
- craft\commerce\base\HasStoreInterface, craft\commerce\base\StatInterface
- Uses traits
- craft\commerce\base\StatTrait, craft\commerce\base\StoreTrait
- Since
- 3.0
Top Customers Stat
Public Properties ​
| Property | Description |
|---|---|
| cache | boolean |
| cacheDuration | integer – How long to cache the data, in seconds. |
| dateRange | string, null |
| limit | integer – Number of customers to show. |
| storeId | integer, null – Store ID |
| type | string – Type of start either 'total' or 'average'. |
| weekStartDay | integer |
limit ​
- Type
- integer
- Default value
5
Number of customers to show.
type ​
- Type
- string
- Default value
'total'
Type of start either 'total' or 'average'.
Protected Properties ​
| Property | Description |
|---|---|
| _handle | string |
_handle ​
- Type
- string
- Default value
'topCustomers'
Public Methods ​
| Method | Description |
|---|---|
| __construct() | Stat constructor. |
| get() | |
| getChartQueryOptionsByInterval() | |
| getData() | |
| getDateRangeInterval() | |
| getDateRangeWording() | |
| getEndDate() | |
| getHandle() | |
| getOrderStatuses() | |
| getStartDate() | |
| getStore() | |
| prepareData() | |
| setEndDate() | |
| setOrderStatuses() | Set order statuses to limit stat query. Accepts array of OrderStatus models, handle strings or uid strings. |
| setStartDate() |
__construct() ​
Stat constructor.
Arguments ​
$dateRange(string, null)$type$startDate(DateTime, boolean, null)$endDate(DateTime, boolean, null)$storeId
Throws ​
getData() ​
Returns ​
mixed
getHandle() ​
prepareData() ​
Arguments ​
$data(mixed)
Returns ​
mixed
Protected Methods ​
| Method | Description |
|---|---|
| _createChartQuery() | |
| _createStatQuery() | Generate base stat query |