+
+ public function formatTime() {
+ $hours = floor($this->time / 60 / 60);
+ $minutes = floor(($this->time / 60) % 60);
+ $seconds = floor($this->time % 60);
+ return sprintf('%d:%02d:%02d', $hours, $minutes, $seconds);
+ }
+
+ public function updateResult($time, $forfeit) {
+ $this->time = $time;
+ $this->forfeit = $forfeit;
+ $this->save();
+ if ($this->wasChanged()) {
+ ResultChanged::dispatch($this);
+ }
+ }
+
+ public function updatePlacement($score, $placement) {
+ $this->score = $score;
+ $this->placement = $placement;
+ $this->save();
+ if ($this->wasChanged()) {
+ ResultChanged::dispatch($this);
+ }
+ }
+
+