MAPG-235 refactor: renamed fields in challenge related tables

This commit is contained in:
balazs committed 2021-05-16 13:14:00 +02:00
1 parent 7a1674fdd0
commit 7792f1c3ff
8 files changed
+36 -38

No files matched your search

+7 -7
View File
@@ -6,13 +6,13 @@ class Challenge extends Model
{
protected static string $table = 'challenges';
protected static array $fields = ['token', 'timer_sec', 'no_move', 'no_pan', 'no_zoom', 'created'];
protected static array $fields = ['token', 'time_limit', 'no_move', 'no_pan', 'no_zoom', 'created'];
protected static array $relations = [];
private int $token;
private ?int $timerSec = null;
private ?int $timeLimit = null;
private bool $noMove = false;
@@ -27,10 +27,10 @@ class Challenge extends Model
$this->token = $token;
}
public function setTimerSec(?int $timerSec): void
public function setTimeLimit(?int $timeLimit): void
{
if(isset($timerSec)) {
$this->timerSec = $timerSec;
if(isset($timeLimit)) {
$this->timeLimit = $timeLimit;
}
}
@@ -64,9 +64,9 @@ class Challenge extends Model
return $this->token;
}
public function getTimerSec(): ?int
public function getTimeLimit(): ?int
{
return $this->timerSec;
return $this->timeLimit;
}
public function getNoMove(): bool
@@ -4,7 +4,7 @@ class PlaceInChallenge extends Model
{
protected static string $table = 'place_in_challenge';
protected static array $fields = ['place_id', 'challenge_id', 'order'];
protected static array $fields = ['place_id', 'challenge_id', 'round'];
protected static array $relations = ['place' => Place::class, 'challenge' => Challenge::class];
@@ -16,7 +16,7 @@ class PlaceInChallenge extends Model
private ?int $challengeId = null;
private int $order;
private int $round;
public function setPlace(Place $place): void
{
@@ -38,9 +38,9 @@ class PlaceInChallenge extends Model
$this->challengeId = $challengeId;
}
public function setOrder(int $order): void
public function setRound(int $round): void
{
$this->order = $order;
$this->round = $round;
}
public function getPlace(): ?Place
@@ -63,8 +63,8 @@ class PlaceInChallenge extends Model
return $this->challengeId;
}
public function getOrder(): int
public function getRound(): int
{
return $this->order;
return $this->round;
}
}
+6 -6
View File
@@ -4,7 +4,7 @@ class UserInChallenge extends Model
{
protected static string $table = 'user_in_challenge';
protected static array $fields = ['user_id', 'challenge_id', 'round', 'time_left', 'is_owner'];
protected static array $fields = ['user_id', 'challenge_id', 'current_round', 'time_left', 'is_owner'];
protected static array $relations = ['user' => User::class, 'challenge' => Challenge::class];
@@ -16,7 +16,7 @@ class UserInChallenge extends Model
private ?int $challengeId = null;
private int $round = 0;
private int $currentRound = 0;
private ?int $timeLeft = null;
@@ -42,9 +42,9 @@ class UserInChallenge extends Model
$this->challengeId = $challengeId;
}
public function setRound(int $round): void
public function setCurrentRound(int $currentRound): void
{
$this->round = $round;
$this->currentRound = $currentRound;
}
public function setTimeLeft(?int $timeLeft): void
@@ -79,9 +79,9 @@ class UserInChallenge extends Model
return $this->challengeId;
}
public function getRound(): int
public function getCurrentRound(): int
{
return $this->round;
return $this->currentRound;
}
public function getTimeLeft(): ?int