Exemplo n.º 1
0
 /**
  * @return Team[]
  */
 public function getStandings()
 {
     /** @var Team[] $teams */
     $teams = $this->teams->toArray();
     $points = array();
     $goalsDifference = array();
     $goalsFor = array();
     foreach ($teams as $k => $team) {
         $points[$k] = $team->getPoints();
         $goalsDifference[$k] = $team->getGoalsDifference();
         $goalsFor[$k] = $team->getGoalsFor();
     }
     array_multisort($points, SORT_DESC, $goalsDifference, SORT_DESC, $goalsFor, SORT_DESC, $teams);
     return $teams;
 }
Exemplo n.º 2
0
 /**
  * @param Team $team
  */
 public function removeTeam(Team $team)
 {
     if (!$this->teams->contains($team)) {
         return;
     }
     $this->teams->removeElement($team);
     $team->removePlayer($this);
 }
Exemplo n.º 3
0
 /**
  * @param Player $player
  */
 public function removePlayer(Player $player)
 {
     if (!$this->players->contains($player)) {
         return;
     }
     $this->players->removeElement($player);
     $player->removeTeam($this);
 }