コード例 #1
0
 public static function Serialize($obj)
 {
     $dto = new \stdClass();
     $dto->FirstName = Primitives::WriteString($obj->FirstName);
     $dto->LastName = Primitives::WriteString($obj->LastName);
     $dto->Email = Primitives::WriteString($obj->Email);
     $dto->PhoneNumber = Primitives::WriteString($obj->PhoneNumber);
     $dto->Nationality = Primitives::WriteString($obj->Nationality);
     $dto->Course = Primitives::WriteString($obj->Course);
     $dto->HowDidYouHearAboutUs = Primitives::WriteString($obj->HowDidYouHearAboutUs);
     $dto->Message = Primitives::WriteString($obj->Message);
     $dto->Locale = Primitives::WriteString($obj->Locale);
     if ($obj->Tracking !== NULL) {
         $dto->Tracking = FormTrackingDto::Serialize($obj->Tracking);
     } else {
         $dto->Tracking = NULL;
     }
     return $dto;
 }
コード例 #2
0
 public static function Serialize($obj)
 {
     $dto = new \stdClass();
     $dto->Locale = Primitives::WriteString($obj->Locale);
     $dto->FirstName = Primitives::WriteString($obj->FirstName);
     $dto->LastName = Primitives::WriteString($obj->LastName);
     $dto->Gender = Primitives::WriteString($obj->Gender);
     $dto->DateOfBirth = Primitives::WriteLocalDate($obj->DateOfBirth);
     $dto->Nationality = Primitives::WriteString($obj->Nationality);
     $dto->CountryOfResidence = Primitives::WriteString($obj->CountryOfResidence);
     $dto->LevelOfEnglish = Primitives::WriteString($obj->LevelOfEnglish);
     $dto->Email = Primitives::WriteString($obj->Email);
     $dto->PhoneNumber = Primitives::WriteString($obj->PhoneNumber);
     $dto->HowDidYouHearAboutUs = Primitives::WriteString($obj->HowDidYouHearAboutUs);
     $dto->PreferredCentre = Primitives::WriteString($obj->PreferredCentre);
     $dto->Course = Primitives::WriteString($obj->Course);
     $dto->CourseStartDate = Primitives::WriteLocalDate($obj->CourseStartDate);
     $dto->LessonsPerWeek = Primitives::WriteInt($obj->LessonsPerWeek);
     $dto->CourseNumberOfWeeks = Primitives::WriteInt($obj->CourseNumberOfWeeks);
     $dto->Accommodation = Primitives::WriteString($obj->Accommodation);
     $dto->AccommodationRoomOption = Primitives::WriteString($obj->AccommodationRoomOption);
     $dto->AccommodationCateringOption = Primitives::WriteString($obj->AccommodationCateringOption);
     $dto->AccommodationBathroomOption = Primitives::WriteString($obj->AccommodationBathroomOption);
     $dto->AccommodationMiscOption = Primitives::WriteString($obj->AccommodationMiscOption);
     $dto->AccommodationNumberOfWeeks = Primitives::WriteInt($obj->AccommodationNumberOfWeeks);
     if ($obj->Extras !== NULL) {
         $tmpArray0 = array();
         $arrayIndex0 = 0;
         foreach ($obj->Extras as $arrayItem0) {
             $tmpArray0[$arrayIndex0] = Primitives::WriteString($arrayItem0);
             ++$arrayIndex0;
         }
         $dto->Extras = $tmpArray0;
     } else {
         $dto->Extras = NULL;
     }
     $dto->Message = Primitives::WriteString($obj->Message);
     $dto->SpecialRequirements = Primitives::WriteString($obj->SpecialRequirements);
     $dto->AcceptsTerms = Primitives::WriteBoolean($obj->AcceptsTerms);
     if ($obj->Tracking !== NULL) {
         $dto->Tracking = FormTrackingDto::Serialize($obj->Tracking);
     } else {
         $dto->Tracking = NULL;
     }
     return $dto;
 }