/** * @param Request $Request * @return TrackEvent */ private function createTrackEventFromRequest(Request $Request) { $TrackEvent = new TrackEvent(); $TrackEvent->setTrackMeetId($Request->get('trackMeetId'))->setTrackEventTypeId($Request->get('trackEventTypeId'))->setEventGender($Request->get('eventGender')); if ($Request->get('eventSubType')) { $TrackEvent->setEventSubType($Request->get('eventSubType')); } if ($Request->get('eventStartTime')) { $Time = new Time($Request->get('eventStartTime')); $TrackEvent->setEventStartTime($Time); } return $TrackEvent; }
/** * @param TrackEvent $TrackEvent * @param TrackRelayTeam $RelayTeam * @param $TeamMembers TrackRelayTeamMember[] * @return int */ public function addRelayTeamEvent(TrackEvent $TrackEvent, TrackRelayTeam $RelayTeam, $TeamMembers) { if (!$TrackEvent->getTrackEventId()) { $RelayTeam->setTrackEventId($this->getMeetEventId($TrackEvent)); } if (!$RelayTeam->getTrackEventId()) { return 0; } $trackRelayTeamId = $this->TrackSQL->addRelayTeam($RelayTeam); if (!$trackRelayTeamId) { return 0; } foreach ($TeamMembers as $TeamMember) { $TeamMember->setTrackRelayTeamId($trackRelayTeamId); $this->TrackSQL->addRelayTeamMember($TeamMember); } return 1; }