Loading Stats events from the database
Just like when loading SystemLogEvents from the database, you can use the provided StatsEvents class to retrieve and work with lists of StatsEvent objects.
For example, let's load the last fifty StatsEventHomeView
objects from our earlier example, using what we learned in the Item lists section of the Items guide:
As you can see, the StatsEvents class accepts some additional keys on top of the usual Items::fillFromParameters keys:
type
Retrieves only StatsEvent objects of this class name. Must include the full namespace route to the class.fromTimestamp
Retrieves StatsEvent objects triggered after this timestamp.toTimestamp
Retrieves StatsEvent objects triggered up to this timestamp.
See examples of loading StatsEvent object from the database in the Triggering a stats event and Events with additional dimensions examples.
Last updated