protected function retrieveTeamId($team) { if (is_object($team)) { $team = $team->getKey(); } if (is_array($team) && isset($team["id"])) { $team = $team["id"]; } return $team; }