| @@ 69-74 (lines=6) @@ | ||
| 66 | if ($group != null) { |
|
| 67 | if ($championship->category->isTeam) { |
|
| 68 | $fighters = $group->teams()->get(); |
|
| 69 | if (sizeof($fighters) == 0) { |
|
| 70 | $fighters->push(new Team()); |
|
| 71 | $fighters->push(new Team()); |
|
| 72 | } else if (count($fighters) % 2 != 0) { |
|
| 73 | $fighters->push(new Team(['name' => 'BYE'])); |
|
| 74 | } |
|
| 75 | return $fighters; |
|
| 76 | } else { |
|
| 77 | $fighters = $group->competitors()->get(); |
|
| @@ 78-83 (lines=6) @@ | ||
| 75 | return $fighters; |
|
| 76 | } else { |
|
| 77 | $fighters = $group->competitors()->get(); |
|
| 78 | if (sizeof($fighters) == 0) { // If |
|
| 79 | $fighters->push(new Competitor()); |
|
| 80 | $fighters->push(new Competitor()); |
|
| 81 | } else if (count($fighters) % 2 != 0) { // If fighter is not pair, add a BYE |
|
| 82 | $fighters->push(new Competitor()); |
|
| 83 | } |
|
| 84 | } |
|
| 85 | return $fighters; |
|
| 86 | } |
|