function _uc_reports_subreport_intervals in Ubercart 5
Same name and namespace in other branches
- 6.2 uc_reports/uc_reports.module \_uc_reports_subreport_intervals()
With a given time span for a report and specified interval for subreports, return a list of timespans for subreports over that report's time span.
@return: An array of keyed arrays with the following values:
- "start": The starting point of the sub report
- "end": The ending point of the sub report
Parameters
$start: A UNIX time stamp representing the time to start the report.
$end: A UNIX time stamp representing the time to end the report.
$granularity: Text representing the amount of time for the subreport (e.g. 'day', 'week')
1 call to _uc_reports_subreport_intervals()
- uc_reports_sales_custom in uc_reports/
uc_reports.module
File
- uc_reports/
uc_reports.module, line 1379 - Displays reports on sales, customers, and products to store admin
Code
function _uc_reports_subreport_intervals($report_start, $report_end, $interval) {
$subreports = array();
for ($start = $report_start, $end = _uc_reports_end_interval($report_start, $interval); $start < $report_end; $start = $end + 1, $end = _uc_reports_end_interval($start, $interval)) {
$subreports[] = array(
'start' => $start,
'end' => $end > $report_end ? $report_end : $end,
);
}
return $subreports;
}