Stat

Type
Abstract Class
Namespace
craft\commerce\base
Inherits
craft\commerce\base\Stat
Implements
craft\commerce\base\StatInterface
Uses traits
craft\commerce\base\StatTrait
Extended by
craft\commerce\stats\AverageOrderTotal, craft\commerce\stats\NewCustomers, craft\commerce\stats\RepeatCustomers, craft\commerce\stats\TopCustomers, craft\commerce\stats\TopProductTypes, craft\commerce\stats\TopProducts, craft\commerce\stats\TopPurchasables, craft\commerce\stats\TotalOrders, craft\commerce\stats\TotalOrdersByCountry, craft\commerce\stats\TotalRevenue
Since
3.0

Stat

View source

# Public Properties

Property Description
cache boolean
cacheDuration integer – How long to cache the data, in seconds.
dateRange string
weekStartDay integer

# Protected Properties

Property Description
_handle string

# Public Methods

# __construct()

Stat constructor.

View source

Arguments

Throws

# get()

View source

Returns

array, false, mixed, null

Throws

# getChartQueryOptionsByInterval()

View source

Arguments

Returns

array, null

# getDateRangeInterval()

View source

Returns

mixed, string

# getDateRangeWording()

View source

Returns

string

# getEndDate()

View source

Returns

mixed

# getHandle()

View source

Returns

string

# getStartDate()

View source

Returns

mixed

# prepareData()

View source

Arguments

  • $data

Returns

mixed

# setEndDate()

View source

Arguments

Returns

mixed

# setStartDate()

View source

Arguments

Returns

mixed

# Protected Methods

Method Description
_createChartQuery()
_createStatQuery() Generate base stat query

# _createChartQuery()

View source

Arguments

Returns

array, null

Throws

# _createStatQuery()

Generate base stat query

View source

Returns

yii\db\Query