ip = $ip; return $this; } /** * Get ip * * @return string */ public function getIp() { return $this->ip; } /** * Set created * * @param \DateTime $created * * @return TravelBooking */ public function setCreated($created) { $this->created = $created; return $this; } /** * Get created * * @return \DateTime */ public function getCreated() { return $this->created; } /** * Set programName * * @param string $programName * * @return TravelBooking */ public function setProgramName($programName) { $this->programName = $programName; return $this; } /** * Get programName * * @return string */ public function getProgramName() { return $this->programName; } /** * Set programId * * @param integer $programId * * @return TravelBooking */ public function setProgramId($programId) { $this->programId = $programId; return $this; } /** * Get programId * * @return integer */ public function getProgramId() { return $this->programId; } /** * Set periodId * * @param integer $periodId * * @return TravelBooking */ public function setPeriodId($periodId) { $this->periodId = $periodId; return $this; } /** * Get periodId * * @return integer */ public function getPeriodId() { return $this->periodId; } /** * Set class * * @param string $class * * @return TravelBooking */ public function setClass($class) { $this->class = $class; return $this; } /** * Get class * * @return string */ public function getClass() { return $this->class; } /** * Set salutationId * * @param integer $salutationId * * @return TravelBooking */ public function setSalutationId($salutationId) { $this->salutationId = $salutationId; return $this; } /** * Get salutationId * * @return integer */ public function getSalutationId() { return $this->salutationId; } /** * Set firstName * * @param string $firstName * * @return TravelBooking */ public function setFirstName($firstName) { $this->firstName = $firstName; return $this; } /** * Get firstName * * @return string */ public function getFirstName() { return $this->firstName; } /** * Set lastName * * @param string $lastName * * @return TravelBooking */ public function setLastName($lastName) { $this->lastName = $lastName; return $this; } /** * Get lastName * * @return string */ public function getLastName() { return $this->lastName; } /** * Set street * * @param string $street * * @return TravelBooking */ public function setStreet($street) { $this->street = $street; return $this; } /** * Get street * * @return string */ public function getStreet() { return $this->street; } /** * Set zipcode * * @param string $zipcode * * @return TravelBooking */ public function setZipcode($zipcode) { $this->zipcode = $zipcode; return $this; } /** * Get zipcode * * @return string */ public function getZipcode() { return $this->zipcode; } /** * Set city * * @param string $city * * @return TravelBooking */ public function setCity($city) { $this->city = $city; return $this; } /** * Get city * * @return string */ public function getCity() { return $this->city; } /** * Set countryId * * @param integer $countryId * * @return TravelBooking */ public function setCountryId($countryId) { $this->countryId = $countryId; return $this; } /** * Get countryId * * @return integer */ public function getCountryId() { return $this->countryId; } /** * Set email * * @param string $email * * @return TravelBooking */ public function setEmail($email) { $this->email = $email; return $this; } /** * Get email * * @return string */ public function getEmail() { return $this->email; } /** * Set phone * * @param string $phone * * @return TravelBooking */ public function setPhone($phone) { $this->phone = $phone; return $this; } /** * Get phone * * @return string */ public function getPhone() { return $this->phone; } /** * Set mobile * * @param string $mobile * * @return TravelBooking */ public function setMobile($mobile) { $this->mobile = $mobile; return $this; } /** * Get mobile * * @return string */ public function getMobile() { return $this->mobile; } /** * Set selectedTravel * * @param string $selectedTravel * * @return TravelBooking */ public function setSelectedTravel($selectedTravel) { $this->selectedTravel = is_array($selectedTravel) ? json_encode($selectedTravel) : $selectedTravel; return $this; } /** * Get selectedTravel * * @return string */ public function getSelectedTravel() { $ret = json_decode($this->selectedTravel, true); if (empty($ret) || !is_array($ret)) { return $this->selectedTravel; } return $ret; } /** * Set selectedDeparture * * @param string $selectedDeparture * * @return TravelBooking */ public function setSelectedDeparture($selectedDeparture) { $this->selectedDeparture = is_array($selectedDeparture) ? json_encode($selectedDeparture) : $selectedDeparture; return $this; } /** * Get selectedDeparture * * @return string */ public function getSelectedDeparture() { $ret = json_decode($this->selectedDeparture, true); if (empty($ret) || !is_array($ret)) { return $this->selectedDeparture; } return $ret; } /** * Set selectedStartDate * * @param \DateTime $selectedStartDate * * @return TravelBooking */ public function setSelectedStartDate($selectedStartDate) { $this->selectedStartDate = $selectedStartDate; return $this; } /** * Get selectedStartDate * * @return \DateTime */ public function getSelectedStartDate() { return $this->selectedStartDate; } /** * Set selectedEndDate * * @param \DateTime $selectedEndDate * * @return TravelBooking */ public function setSelectedEndDate($selectedEndDate) { $this->selectedEndDate = $selectedEndDate; return $this; } /** * Get selectedEndDate * * @return \DateTime */ public function getSelectedEndDate() { return $this->selectedEndDate; } /** * Set selectedAdults * * @param integer $selectedAdults * * @return TravelBooking */ public function setSelectedAdults($selectedAdults) { $this->selectedAdults = $selectedAdults; return $this; } /** * Get selectedAdults * * @return integer */ public function getSelectedAdults() { return $this->selectedAdults; } /** * Set selectedChilds * * @param integer $selectedChilds * * @return TravelBooking */ public function setSelectedChilds($selectedChilds) { $this->selectedChilds = $selectedChilds; return $this; } /** * Get selectedChilds * * @return integer */ public function getSelectedChilds() { return $this->selectedChilds; } /** * Set selectedChild3 * * @param integer $selectedChild3 * * @return TravelBooking */ public function setSelectedChild3($selectedChild3) { $this->selectedChild3 = $selectedChild3; return $this; } /** * Get selectedChild3 * * @return integer */ public function getSelectedChild3() { return $this->selectedChild3; } /** * Set drafts * * @param string $drafts * * @return TravelBooking */ public function setDrafts($drafts) { $this->drafts = is_array($drafts) ? json_encode($drafts) : $drafts; return $this; } /** * Get drafts * * @return string */ public function getDrafts() { $ret = json_decode($this->drafts, true); if (empty($ret) || !is_array($ret)) { return $this->drafts; } return $ret; } /** * Set rooms * * @param string $rooms * * @return TravelBooking */ public function setRooms($rooms) { $this->rooms = is_array($rooms) ? json_encode($rooms) : $rooms; return $this; } /** * Get rooms * * @return string */ public function getRooms() { $ret = json_decode($this->rooms, true); if (empty($ret) || !is_array($ret)) { return $this->rooms; } return $ret; } /** * Set rooms * * @param string $serviceItems * * @return TravelBooking */ public function setServiceItems($serviceItems) { $this->serviceItems = is_array($serviceItems) ? json_encode($serviceItems) : $serviceItems; return $this; } /** * Get serviceItems * * @return string */ public function getServiceItems() { $ret = json_decode($this->serviceItems, true); if (empty($ret) || !is_array($ret)) { return $this->serviceItems; } return $ret; } /** * Set rooms * * @param string $arrangements * * @return TravelBooking */ public function setArrangements($arrangements) { $this->arrangements = is_array($arrangements) ? json_encode($arrangements) : $arrangements; return $this; } /** * Get arrangements * * @return string */ public function getArrangements() { $ret = json_decode($this->arrangements, true); if (empty($ret) || !is_array($ret)) { return $this->arrangements; } return $ret; } /** * Set participants * * @param Traveler[] $travelers * * @return TravelBooking */ public function setParticipants($travelers) { if (!is_array($travelers)) { $this->participants = $travelers; return $this; } $participants = []; foreach($travelers as $traveler) { $birthdate = $traveler->getBirthDate(); if(!strtotime($birthdate)){ $birthdate = '01.01.1900'; } $participants[] = [ 'gender' => $traveler->getSex(), 'first_name' => $traveler->getFirstName(), 'last_name' => $traveler->getLastName(), 'birthday' => $birthdate, 'nationality' => $traveler->getNationality(), 'child' => $traveler->isChild(), 'acceptEntryRequirements' => $traveler->isAcceptEntryRequirements(), ]; } $this->participants = json_encode($participants); return $this; } /** * Get participants * * @return string */ public function getParticipants() { $participants = json_decode($this->participants, true); if (empty($participants) || !is_array($participants)) { return $this->participants; } $ret = []; foreach ($participants as $participant) { $traveler = new Traveler(); $traveler->setSex(intval($participant['gender'])); $traveler->setFirstName($participant['first_name']); $traveler->setLastName($participant['last_name']); $traveler->setNationality($participant['nationality']); $traveler->setChild($participant['child']); if(!strtotime($participant['birthday'])){ $participant['birthday'] = '01.01.1900'; } $traveler->setBirthDate(\DateTime::createFromFormat('d.m.Y', $participant['birthday'])); $ret[] = $traveler; } return $ret; } /** * Set participantsTotal * * @param integer $participantsTotal * * @return TravelBooking */ public function setParticipantsTotal($participantsTotal) { $this->participantsTotal = $participantsTotal; return $this; } /** * Get participantsTotal * * @return integer */ public function getParticipantsTotal() { return $this->participantsTotal; } /** * Set price * * @param float $price * * @return TravelBooking */ public function setPrice($price) { $this->price = $price; return $this; } /** * Get price * * @return float */ public function getPrice() { return $this->price; } /** * Set priceTotal * * @param float $priceTotal * * @return TravelBooking */ public function setPriceTotal($priceTotal) { $this->priceTotal = $priceTotal; return $this; } /** * Get priceTotal * * @return float */ public function getPriceTotal() { return $this->priceTotal; } /** * Set depositTotal * * @param float $depositTotal * * @return TravelBooking */ public function setDepositTotal($depositTotal) { $this->depositTotal = $depositTotal; return $this; } /** * Get depositTotal * * @return float */ public function getDepositTotal() { return $this->depositTotal; } /** * Set finalPayment * * @param float $finalPayment * * @return TravelBooking */ public function setFinalPayment($finalPayment) { $this->finalPayment = $finalPayment; return $this; } /** * Get finalPayment * * @return float */ public function getFinalPayment() { return $this->finalPayment; } /** * Set finalPaymentDate * * @param \DateTime $finalPaymentDate * * @return TravelBooking */ public function setFinalPaymentDate($finalPaymentDate) { $this->finalPaymentDate = $finalPaymentDate; return $this; } /** * Get finalPaymentDate * * @return \DateTime */ public function getFinalPaymentDate() { return $this->finalPaymentDate; } /** * Set comments * * @param string $comments * * @return TravelBooking */ public function setComments($comments) { $this->comments = $comments; return $this; } /** * Get comments * * @return string */ public function getComments() { return $this->comments; } /** * Set insuranceName * * @param string $insuranceName * * @return TravelBooking */ public function setInsuranceName($insuranceName) { $this->insuranceName = $insuranceName; return $this; } /** * Get insuranceName * * @return string */ public function getInsuranceName() { return $this->insuranceName; } /** * Set insurances * * @param string $insurances * * @return TravelBooking */ public function setInsurances($insurances) { $this->insurances = is_array($insurances) ? json_encode($insurances) : $insurances; return $this; } /** * Get insurances * * @return string */ public function getInsurances() { $ret = json_decode($this->insurances, true); if (empty($ret) || !is_array($ret)) { return $this->insurances; } return $ret; } /** * Set insuranceOffer * * @param string $insuranceOffer * * @return TravelBooking */ public function setInsuranceOffer($insuranceOffer) { $this->insuranceOffer = $insuranceOffer; return $this; } /** * Get insuranceOffer * * @return string */ public function getInsuranceOffer() { return $this->insuranceOffer; } /** * Set travelCancellation * * @param string $travelCancellation * * @return TravelBooking */ public function setTravelCancellation($travelCancellation) { $this->travelCancellation = $travelCancellation; return $this; } /** * Get travelCancellation * * @return string */ public function getTravelCancellation() { return $this->travelCancellation; } /** * Set options * * @param string $options * * @return TravelBooking */ public function setOptions($options) { $this->options = is_array($options) ? json_encode($options) : $options; return $this; } /** * Get options * * @return string */ public function getOptions() { $ret = json_decode($this->options, true); if (empty($ret) || !is_array($ret)) { return $this->options; } return $ret; } /** * Set classOptions * * @param string $classOptions * * @return TravelBooking */ public function setClassOptions($classOptions) { $this->classOptions = is_array($classOptions) ? json_encode($classOptions) : $classOptions; return $this; } /** * Get classOptions * * @return string */ public function getClassOptions() { $ret = json_decode($this->classOptions, true); if (empty($ret) || !is_array($ret)) { return $this->classOptions; } return $ret; } /** * Set extraCategory * * @param string $extraCategory * * @return TravelBooking */ public function setExtraCategory($extraCategory) { $this->extraCategory = is_array($extraCategory) ? json_encode($extraCategory) : $extraCategory; return $this; } /** * Get extraCategory * * @return string */ public function getExtraCategory() { $ret = json_decode($this->extraCategory, true); if (empty($ret) || !is_array($ret)) { return $this->extraCategory; } return $ret; } /** * Set extraCategory * * @param string $extraCategory * * @return TravelBooking */ public function setAcceptLegalRights($acceptLegalRights) { $this->acceptLegalRights = $acceptLegalRights; return $this; } /** * Get extraCategory * * @return string */ public function getAcceptLegalRights() { return $this->acceptLegalRights; } /** * Get id * * @return integer */ public function getId() { return $this->id; } }