/** * Update last activity time * * @param int $idUser * @param string $sessionHash */ public function updateSession($idUser, $sessionHash = null) { if (!empty($idUser)) { $update = array('lastActivityTime' => DB::sqlEval('NOW()')); if ($sessionHash !== null) { $update['lastSession'] = $sessionHash; } $this->db->update($this->table, $update, $this->primary_key . ' = %i', $idUser); } }