You are here

function opigno_lrs_stats_aggregate_statements_by_day in Opigno TinCan API 7

Aggregate statements by day

Output example: array( '2015-01-01' => statements, '2015-01-05' => statements, '2015-01-07' => statements )

Return value

array

1 call to opigno_lrs_stats_aggregate_statements_by_day()
opigno_lrs_stats_dashboard_current_week_total_number_of_page_view_per_day_between in modules/opigno_tincan_api_stats/includes/dashboard/model.inc
Aggregate total number of page per day between two dates for the given statements

File

modules/opigno_tincan_api_stats/includes/model/aggregations.inc, line 20
Implements functions to aggregate statements

Code

function opigno_lrs_stats_aggregate_statements_by_day($statements) {
  $statements_per_day = array();
  foreach ($statements as $statement) {
    $statements_per_day[$statement->timestamp
      ->format('Y-m-d')][] = $statement;
  }
  return $statements_per_day;
}