You are here

function opigno_lrs_stats_first_statement_timestamp in Opigno TinCan API 7

Retrieve first statement timestamp from LRS

Return value

DateTime

1 call to opigno_lrs_stats_first_statement_timestamp()
opigno_lrs_stats_dashboard_total_number_of_page_view_json_page in modules/opigno_tincan_api_stats/includes/dashboard/dashboard.pages.inc
Display total number of page view in json (morris.js format)

File

modules/opigno_tincan_api_stats/includes/model/helpers.inc, line 77
Implements helper functions

Code

function opigno_lrs_stats_first_statement_timestamp() {
  $statements = opigno_lrs_stats_all_statements();
  $first_statement = (object) array(
    'timestamp' => new DateTime(),
  );

  //Fake statement of today
  foreach ($statements as $statement) {
    if ($statement->timestamp < $first_statement->timestamp) {
      $first_statement = $statement;
    }
  }
  return $first_statement->timestamp;
}