BUGFIX: Round::getBye() did not return bye players

This commit is contained in:
Jeroen De Meerleer 2019-06-04 15:37:06 +02:00
parent 9f0f8999ec
commit 112240a038
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,7 @@ class Round extends RoundModel
$allPairings = $this->getPairings();
$byePairings = [];
foreach ($allPairings as $pairing) {
if ($pairing->getResult() == Result::bye) {
if ($pairing->getResult() == Result::wonbye) {
$byePairings[] = $pairing;
}
}

View File

@ -70,6 +70,8 @@ echo "Color Pairing 3: " . $sws->getTournament()->getPairings()[3]->getColor()->
echo "Player Pairing 1: " . $sws->getTournament()->getPairings()[0]->getPlayer()->getName() . PHP_EOL;
echo "Player Pairing 2: " . $sws->getTournament()->getPairings()[1]->getPlayer()->getName() . PHP_EOL;
echo "Player Pairing 3: " . $sws->getTournament()->getPairings()[2]->getPlayer()->getName() . PHP_EOL;
echo "Bye Round 1: " . $sws->getTournament()->getRoundByNo(2)->getBye()[0]->getPlayer()->getName() . PHP_EOL;
echo "Absent Round 1: " . $sws->getTournament()->getRoundByNo(2)->getAbsent()[0]->getPlayer()->getName() . PHP_EOL;
echo "Tiebreak 1: " . $sws->getTournament()->getTiebreaks()[0]->getValue() . PHP_EOL;
echo "Tiebreak 2: " . $sws->getTournament()->getTiebreaks()[1]->getValue() . PHP_EOL;
echo "Tiebreak 3: " . $sws->getTournament()->getTiebreaks()[2]->getValue() . PHP_EOL;