コード例 #1
0
ファイル: Extra.php プロジェクト: dgcollard/cruk-event-sdk
 /**
  * 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;
 }
コード例 #2
0
 /**
  * @param Extra $extra
  */
 public function addExtra($extra)
 {
     $this->extras[$extra->getExtraKey()] = $extra;
 }