totals = new UserStatsInSessionRow(); $this->sessionDebriefRows = array(); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public function setSessionTotals (array $row) { $this->nbSessions = (int)$row['NbSessions']; $this->totalDuration = (float)$row['TotalDuration']; $this->firstSession = $row['MinDate']; $this->lastSession = $row['MaxDate']; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public function toArray () : array { return array ( "nbSessions" => (int)$this->nbSessions, "totalDuration" => (float)$this->totalDuration ?? 0.0, "firstSessionAsString" => $this->firstSession ?? "", "lastSessionAsString" => $this->lastSession ?? "", "totals" => $this->totals->toArray(), "sessionDebriefRows" => $this->sessionDebriefRows ); } } ?>