Fixed getBye to return wonBye players

This commit is contained in:
Jeroen De Meerleer 2019-06-04 15:35:21 +02:00
parent 722cfe685a
commit 11b07f07d0
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(); $allPairings = $this->getPairings();
$byePairings = []; $byePairings = [];
foreach ($allPairings as $pairing) { foreach ($allPairings as $pairing) {
if ($pairing->getResult() == Result::bye) { if ($pairing->getResult() == Result::wonbye) {
$byePairings[] = $pairing; $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 1: " . $sws->getTournament()->getPairings()[0]->getPlayer()->getName() . PHP_EOL;
echo "Player Pairing 2: " . $sws->getTournament()->getPairings()[1]->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 "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 1: " . $sws->getTournament()->getTiebreaks()[0]->getValue() . PHP_EOL;
echo "Tiebreak 2: " . $sws->getTournament()->getTiebreaks()[1]->getValue() . PHP_EOL; echo "Tiebreak 2: " . $sws->getTournament()->getTiebreaks()[1]->getValue() . PHP_EOL;
echo "Tiebreak 3: " . $sws->getTournament()->getTiebreaks()[2]->getValue() . PHP_EOL; echo "Tiebreak 3: " . $sws->getTournament()->getTiebreaks()[2]->getValue() . PHP_EOL;