| @@ 43-52 (lines=10) @@ | ||
| 40 | public function createAction(Player $me) |
|
| 41 | { |
|
| 42 | return $this->create($me, function(Match $match) use ($me) { |
|
| 43 | if ($me->canEdit($match) |
|
| 44 | && (!$match->getTeamA()->isLastMatch($match) |
|
| 45 | || !$match->getTeamB()->isLastMatch($match)) |
|
| 46 | ) { |
|
| 47 | $url = Service::getGenerator()->generate('match_recalculate', array( |
|
| 48 | 'match' => $match->getId(), |
|
| 49 | )); |
|
| 50 | ||
| 51 | return new RedirectResponse($url); |
|
| 52 | } |
|
| 53 | }); |
|
| 54 | } |
|
| 55 | ||
| @@ 59-68 (lines=10) @@ | ||
| 56 | public function deleteAction(Player $me, Match $match) |
|
| 57 | { |
|
| 58 | return $this->delete($match, $me, function() use ($match, $me) { |
|
| 59 | if ($match->getTeamA()->isLastMatch($match) |
|
| 60 | && $match->getTeamB()->isLastMatch($match)) { |
|
| 61 | $match->resetELOs(); |
|
| 62 | } elseif ($me->canEdit($match)) { |
|
| 63 | $url = Service::getGenerator()->generate('match_recalculate', array( |
|
| 64 | 'match' => $match->getId(), |
|
| 65 | )); |
|
| 66 | ||
| 67 | return new RedirectResponse($url); |
|
| 68 | } |
|
| 69 | }); |
|
| 70 | } |
|
| 71 | ||