/** * Set the user bound to this player * * @param User $user * @return null */ public function setUser(User $user = null) { $this->user = $user; if ($this->user) { $this->elo = $user->getElo(); $this->getGame()->addUserId($user->getId()); } }