MAPG-235 new challenge can be created and is prepared

This commit is contained in:
balazs committed 2021-05-12 13:51:06 +02:00
1 parent 99244e93d2
commit d7147b30d6
14 files changed
+289 -17

No files matched your search

+10 -8
View File
@@ -4,7 +4,7 @@ use DateTime;
class Challenge extends Model
{
protected static string $table = 'challenge';
protected static string $table = 'challenges';
protected static array $fields = ['token', 'timer_sec', 'no_move', 'no_pan', 'no_zoom', 'created'];
@@ -12,13 +12,13 @@ class Challenge extends Model
private int $token;
private int $timerSec;
private ?int $timerSec = null;
private bool $noMove;
private bool $noMove = false;
private bool $noPan;
private bool $noPan = false;
private bool $noZoom;
private bool $noZoom = false;
private DateTime $created;
@@ -27,9 +27,11 @@ class Challenge extends Model
$this->token = $token;
}
public function setTimerSec(int $timerSec): void
public function setTimerSec(?int $timerSec): void
{
$this->timerSec = $timerSec;
if(isset($timerSec)) {
$this->timerSec = $timerSec;
}
}
public function setNoMove(bool $noMove): void
@@ -62,7 +64,7 @@ class Challenge extends Model
return $this->token;
}
public function getTimerSec(): int
public function getTimerSec(): ?int
{
return $this->timerSec;
}