Example #1
0
 /**
  * Fills steps other than step1
  * @param ApplicationTemp $app
  */
 private function fillStepsRemaining(ApplicationTemp $app)
 {
     $app->setRenewal(1);
     $app->setPersonId($this->getUser()->getId());
     $app->setPremiumChoice(1);
     $app->setPremiumSize(0);
     $member = MemberPeer::retrieveByPK($this->getUser()->getMemberId());
     if ($member) {
         $app->setMemberId($member->getId());
         $v = explode(' ', $member->getSpouseName());
         $app->setSpouseFirstName((string) $v[0]);
         $app->setSpouseLastName((string) $v[1]);
         $app->setEmergencyContactName($member->getEmergencyContactName());
         $app->setEmergencyContactPhone($member->getEmergencyContactPhone());
         $app->setApplicantCopilot($member->getCoPilot());
         $app->setLanguagesSpoken($member->getLanguages());
         $app->setDateOfBirth($member->getDateOfBirth());
         $app->setDriversLicenseNumber($member->getDriversLicenseNumber());
         $app->setDriversLicenseState($member->getDriversLicenseState());
         $app->setWeight($member->getWeight());
         $app->setWingId($member->getWingId());
         $app->setMemberClassId($member->getMemberClassId());
         $pilot = PilotPeer::retrieveByPK($this->getUser()->getPilotId());
         if ($pilot) {
             $airport = $pilot->getAirport();
             $app->setHomeBase($airport->getIdent());
             $v = array();
             foreach ($airport->getFbos() as $fbo) {
                 $v[] = $fbo->getName();
             }
             $app->setFboName(implode(', ', $v));
             $v = array();
             if ($pilot->getIfr()) {
                 $v[] = 'IFR';
             }
             if ($pilot->getMultiEngine()) {
                 $v[] = 'multi';
             }
             if ($pilot->getOtherRatings()) {
                 $v[] = 'other';
             }
             if ($pilot->getSeInstructor()) {
                 $v[] = $pilot->getSeInstructor();
             }
             if ($pilot->getSeInstructor()) {
                 $v[] = $pilot->getMeInstructor();
             }
             if ($pilot->getLicenseType()) {
                 $v[] = $pilot->getLicenseType();
             }
             $app->setRatings(implode(', ', $v));
             $app->setTotalHours($pilot->getTotalHours());
         }
         $availability = $member->getAvailability();
         if ($availability) {
             $app->setAvailabilityWeekdays($availability->getNoWeekday() ? 0 : 1);
             $app->setAvailabilityWeeknights($availability->getNoNight() ? 0 : 1);
             $app->setAvailabilityWeekends($availability->getNoWeekend() ? 0 : 1);
             $app->setAvailabilityLastMinute($availability->getLastMinute());
             $app->setAvailabilityCopilot($availability->getAsMissionMssistant());
         }
         $pilot_aircrafts = $member->getPilotAircrafts();
         /* @var $p_a PilotAircraft */
         if (isset($pilot_aircrafts[0])) {
             $p_a = $pilot_aircrafts[0];
             $app->setAircraftPrimaryId($p_a->getAircraftId());
             $app->setAircraftPrimaryOwn($p_a->getOwn());
             $app->setAircraftPrimarySeats($p_a->getSeats());
             $app->setAircraftPrimaryIce($p_a->getKnownIce());
             $app->setAircraftPrimaryNNumber($p_a->getNNumber());
         }
         if (isset($pilot_aircrafts[1])) {
             $p_a = $pilot_aircrafts[1];
             $app->setAircraftSecondaryId($p_a->getAircraftId());
             $app->setAircraftSecondaryOwn($p_a->getOwn());
             $app->setAircraftSecondarySeats($p_a->getSeats());
             $app->setAircraftSecondaryIce($p_a->getKnownIce());
             $app->setAircraftSecondaryNNumber($p_a->getNNumber());
         }
         if (isset($pilot_aircrafts[2])) {
             $p_a = $pilot_aircrafts[2];
             $app->setAircraftThirdId($p_a->getAircraftId());
             $app->setAircraftThirdOwn($p_a->getOwn());
             $app->setAircraftThirdSeats($p_a->getSeats());
             $app->setAircraftThirdIce($p_a->getKnownIce());
             $app->setAircraftThirdNNumber($p_a->getNNumber());
         }
         $application = $member->getLastApplication();
         if ($application) {
             $app->setPremiumChoice($application->getPremiumChoice());
             $app->setMissionOrientation($application->getMissionOrientation());
             $app->setMissionCoordination($application->getMissionCoordination());
             $app->setPilotRecruitment($application->getPilotRecruitment());
             $app->setFundRaising($application->getFundRaising());
             $app->setCelebrityContacts($application->getCelebrityContacts());
             $app->setGraphicArts($application->getGraphicArts());
             $app->setHospitalOutreach($application->getHospitalOutreach());
             $app->setEventPlanning($application->getEventPlanning());
             $app->setMediaRelations($application->getMediaRelations());
             $app->setTelephoneWork($application->getTelephoneWork());
             $app->setComputers($application->getComputers());
             $app->setClerical($application->getClerical());
             $app->setPrinting($application->getPrinting());
             $app->setWriting($application->getWriting());
             $app->setSpeakersBureau($application->getSpeakersBureau());
             $app->setWingTeam($application->getWingTeam());
             $app->setWebInternet($application->getWebInternet());
             $app->setFoundationContacts($application->getFoundationContacts());
             $app->setAviationContacts($application->getAviationContacts());
             $app->setMemberAopa($application->getMemberAopa());
             $app->setMemberKiwanis($application->getMemberKiwanis());
             $app->setMemberRotary($application->getMemberRotary());
             $app->setMemberLions($application->getMemberLions());
             $app->setMember99s($application->getMember99s());
             $app->setMemberWia($application->getMemberWia());
             $app->setCompanyName($application->getCompany());
             $app->setCompanyPosition($application->getCompanyPosition());
             $app->setCompanyMatchFunds($application->getCompanyMatchFunds());
             $app->setHeight($application->getHeight());
             $app->setPilotCertificate($application->getPilotCertificate());
             $app->setMedicalClass($application->getMedicalClass());
         }
     }
 }