|
Open Monograph Press
3.3.0
|
Public Member Functions | |
| filterRecordFile ($record) | |
| filterRecordHtml ($record) | |
| filterRecordOther ($record) | |
| filterRecordPdf ($record) | |
| getEmptyTimelineIntervals ($startDate, $endDate, $timelineInterval) | |
| getOrderedObjects ($groupBy, $orderDirection, $args=[]) | |
| getRecords ($args=[]) | |
| getTimeline ($timelineInterval, $args=[]) | |
| sumMetric ($total, $record) | |
Protected Member Functions | |
| getQueryBuilder ($args=[]) | |
Definition at line 18 of file PKPStatsService.inc.php.
| PKP\Services\PKPStatsService::filterRecordFile | ( | $record | ) |
A callback to be used with array_filter() to return records for a file (galley, representation).
| array | $record |
Definition at line 222 of file PKPStatsService.inc.php.
| PKP\Services\PKPStatsService::filterRecordHtml | ( | $record | ) |
A callback to be used with array_filter() to return records for a HTML file.
| array | $record |
Definition at line 244 of file PKPStatsService.inc.php.
| PKP\Services\PKPStatsService::filterRecordOther | ( | $record | ) |
A callback to be used with array_filter() to return records for any Other files (all files that are not PDF or HTML).
| array | $record |
Definition at line 255 of file PKPStatsService.inc.php.
| PKP\Services\PKPStatsService::filterRecordPdf | ( | $record | ) |
A callback to be used with array_filter() to return records for a pdf file.
| array | $record |
Definition at line 233 of file PKPStatsService.inc.php.
| PKP\Services\PKPStatsService::getEmptyTimelineIntervals | ( | $startDate, | |
| $endDate, | |||
| $timelineInterval | |||
| ) |
Get all time segments (months or days) between the start and end date with empty values.
| $startDate | string |
| $endDate | string |
| $timelineInterval | string STATISTICS_DIMENSION_MONTH or STATISTICS_DIMENSION_DAY |
Definition at line 268 of file PKPStatsService.inc.php.
References PKPApplication\get().
Referenced by PKP\Services\PKPStatsService\getTimeline().
| PKP\Services\PKPStatsService::getOrderedObjects | ( | $groupBy, | |
| $orderDirection, | |||
$args = [] |
|||
| ) |
Get a list of objects ordered by their total stats
The $args argument is used to determine what records to include in the results. The $groupBy argument is used to group these records.
For example, to get a list of submissions ordered by their total PDF galley views:
// Get all records with the PDF file type $args = ['fileType' => STATISTICS_FILE_TYPE_PDF]
// Group them by their submission ID $groupBy = STATISTICS_DIMENSION_SUBMISSION_ID
| string | $groupBy | The column to sum the stats by. |
| string | $orderDirection | STATISTICS_ORDER_ASC or STATISTICS_ORDER_DESC |
| array | $args | Filter the records to include. See self::getRecords() |
Definition at line 161 of file PKPStatsService.inc.php.
References HookRegistry\call(), DAORegistry\getDAO(), and PKP\Services\PKPStatsService\getQueryBuilder().
|
protected |
Get a QueryBuilder object with the passed args
| array | $args | See self::getRecords() |
Definition at line 302 of file PKPStatsService.inc.php.
References HookRegistry\call().
Referenced by PKP\Services\PKPStatsService\getOrderedObjects(), PKP\Services\PKPStatsService\getRecords(), and PKP\Services\PKPStatsService\getTimeline().
| PKP\Services\PKPStatsService::getRecords | ( | $args = [] | ) |
Get all statistics records that match the passed arguments
| array | $args | [ @option array contextIds Return records for these contexts @option array submissionIds Return records for these submissions @option array sectionIds Return records for these sections @option string dateEnd Return records on or before this date @option string dateStart Return records on or after this date @option array assocTypes Return records for these types of objects. One of ASSOC_TYPE_* @option array assocIds Return records for these objects. Only used when assocTypes is set. @option array fileTypes Return records for these file types. One of STATISTICS_FILE_TYPE_* ] |
Definition at line 35 of file PKPStatsService.inc.php.
References HookRegistry\call(), DAORegistry\getDAO(), and PKP\Services\PKPStatsService\getQueryBuilder().
| PKP\Services\PKPStatsService::getTimeline | ( | $timelineInterval, | |
$args = [] |
|||
| ) |
Get the sum of a set of metrics broken down by day or month
| string | $timelineInterval | STATISTICS_DIMENSION_MONTH or STATISTICS_DIMENSION_DAY |
| array | $args | Filter the records to include. See self::getRecords() |
Definition at line 93 of file PKPStatsService.inc.php.
References HookRegistry\call(), DAORegistry\getDAO(), PKP\Services\PKPStatsService\getEmptyTimelineIntervals(), and PKP\Services\PKPStatsService\getQueryBuilder().
| PKP\Services\PKPStatsService::sumMetric | ( | $total, | |
| $record | |||
| ) |
A callback to be used with array_reduce() to add up the metric value for a record
| array | $record |
Definition at line 210 of file PKPStatsService.inc.php.