/** * Simple function that allows us to get an array of extras * @param Participant $participant * @return Extra[] */ public static function getExtrasForParticipant($participant) { $path = $participant->getClient()->getPath() . "/events/{$participant->getEvent()->getEventCode()}" . "/registrations/{$participant->getRegistration()->getRegistrationId()}" . "/participantInfos/{$participant->getUniqueId()}" . "/extras.json"; $json = $participant->client->requestJson('GET', $path); $extras = array(); foreach ($json as $extra) { $extra = new Extra($participant->getClient(), $extra, $participant); $extras[$extra->getExtraKey()] = $extra; } return $extras; }
/** * @param Extra $extra */ public function addExtra($extra) { $this->extras[$extra->getExtraKey()] = $extra; }