1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | namespace Worldline\Connect\Sdk\V1\Domain; |
7: | |
8: | use UnexpectedValueException; |
9: | use Worldline\Connect\Sdk\Domain\DataObject; |
10: | |
11: | |
12: | |
13: | |
14: | class AirlineData extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $agentNumericCode = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $code = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $flightDate = null; |
30: | |
31: | |
32: | |
33: | |
34: | public $flightLegs = null; |
35: | |
36: | |
37: | |
38: | |
39: | public $invoiceNumber = null; |
40: | |
41: | |
42: | |
43: | |
44: | public $isETicket = null; |
45: | |
46: | |
47: | |
48: | |
49: | |
50: | public $isRegisteredCustomer = null; |
51: | |
52: | |
53: | |
54: | |
55: | public $isRestrictedTicket = null; |
56: | |
57: | |
58: | |
59: | |
60: | public $isThirdParty = null; |
61: | |
62: | |
63: | |
64: | |
65: | public $issueDate = null; |
66: | |
67: | |
68: | |
69: | |
70: | public $merchantCustomerId = null; |
71: | |
72: | |
73: | |
74: | |
75: | public $name = null; |
76: | |
77: | |
78: | |
79: | |
80: | public $numberInParty = null; |
81: | |
82: | |
83: | |
84: | |
85: | public $passengerName = null; |
86: | |
87: | |
88: | |
89: | |
90: | public $passengers = null; |
91: | |
92: | |
93: | |
94: | |
95: | public $placeOfIssue = null; |
96: | |
97: | |
98: | |
99: | |
100: | public $pnr = null; |
101: | |
102: | |
103: | |
104: | |
105: | public $pointOfSale = null; |
106: | |
107: | |
108: | |
109: | |
110: | public $posCityCode = null; |
111: | |
112: | |
113: | |
114: | |
115: | public $ticketDeliveryMethod = null; |
116: | |
117: | |
118: | |
119: | |
120: | public $ticketNumber = null; |
121: | |
122: | |
123: | |
124: | |
125: | public $totalFare = null; |
126: | |
127: | |
128: | |
129: | |
130: | public $totalFee = null; |
131: | |
132: | |
133: | |
134: | |
135: | public $totalTaxes = null; |
136: | |
137: | |
138: | |
139: | |
140: | public $travelAgencyName = null; |
141: | |
142: | |
143: | |
144: | |
145: | public function toObject() |
146: | { |
147: | $object = parent::toObject(); |
148: | if (!is_null($this->agentNumericCode)) { |
149: | $object->agentNumericCode = $this->agentNumericCode; |
150: | } |
151: | if (!is_null($this->code)) { |
152: | $object->code = $this->code; |
153: | } |
154: | if (!is_null($this->flightDate)) { |
155: | $object->flightDate = $this->flightDate; |
156: | } |
157: | if (!is_null($this->flightLegs)) { |
158: | $object->flightLegs = []; |
159: | foreach ($this->flightLegs as $element) { |
160: | if (!is_null($element)) { |
161: | $object->flightLegs[] = $element->toObject(); |
162: | } |
163: | } |
164: | } |
165: | if (!is_null($this->invoiceNumber)) { |
166: | $object->invoiceNumber = $this->invoiceNumber; |
167: | } |
168: | if (!is_null($this->isETicket)) { |
169: | $object->isETicket = $this->isETicket; |
170: | } |
171: | if (!is_null($this->isRegisteredCustomer)) { |
172: | $object->isRegisteredCustomer = $this->isRegisteredCustomer; |
173: | } |
174: | if (!is_null($this->isRestrictedTicket)) { |
175: | $object->isRestrictedTicket = $this->isRestrictedTicket; |
176: | } |
177: | if (!is_null($this->isThirdParty)) { |
178: | $object->isThirdParty = $this->isThirdParty; |
179: | } |
180: | if (!is_null($this->issueDate)) { |
181: | $object->issueDate = $this->issueDate; |
182: | } |
183: | if (!is_null($this->merchantCustomerId)) { |
184: | $object->merchantCustomerId = $this->merchantCustomerId; |
185: | } |
186: | if (!is_null($this->name)) { |
187: | $object->name = $this->name; |
188: | } |
189: | if (!is_null($this->numberInParty)) { |
190: | $object->numberInParty = $this->numberInParty; |
191: | } |
192: | if (!is_null($this->passengerName)) { |
193: | $object->passengerName = $this->passengerName; |
194: | } |
195: | if (!is_null($this->passengers)) { |
196: | $object->passengers = []; |
197: | foreach ($this->passengers as $element) { |
198: | if (!is_null($element)) { |
199: | $object->passengers[] = $element->toObject(); |
200: | } |
201: | } |
202: | } |
203: | if (!is_null($this->placeOfIssue)) { |
204: | $object->placeOfIssue = $this->placeOfIssue; |
205: | } |
206: | if (!is_null($this->pnr)) { |
207: | $object->pnr = $this->pnr; |
208: | } |
209: | if (!is_null($this->pointOfSale)) { |
210: | $object->pointOfSale = $this->pointOfSale; |
211: | } |
212: | if (!is_null($this->posCityCode)) { |
213: | $object->posCityCode = $this->posCityCode; |
214: | } |
215: | if (!is_null($this->ticketDeliveryMethod)) { |
216: | $object->ticketDeliveryMethod = $this->ticketDeliveryMethod; |
217: | } |
218: | if (!is_null($this->ticketNumber)) { |
219: | $object->ticketNumber = $this->ticketNumber; |
220: | } |
221: | if (!is_null($this->totalFare)) { |
222: | $object->totalFare = $this->totalFare; |
223: | } |
224: | if (!is_null($this->totalFee)) { |
225: | $object->totalFee = $this->totalFee; |
226: | } |
227: | if (!is_null($this->totalTaxes)) { |
228: | $object->totalTaxes = $this->totalTaxes; |
229: | } |
230: | if (!is_null($this->travelAgencyName)) { |
231: | $object->travelAgencyName = $this->travelAgencyName; |
232: | } |
233: | return $object; |
234: | } |
235: | |
236: | |
237: | |
238: | |
239: | |
240: | |
241: | public function fromObject($object) |
242: | { |
243: | parent::fromObject($object); |
244: | if (property_exists($object, 'agentNumericCode')) { |
245: | $this->agentNumericCode = $object->agentNumericCode; |
246: | } |
247: | if (property_exists($object, 'code')) { |
248: | $this->code = $object->code; |
249: | } |
250: | if (property_exists($object, 'flightDate')) { |
251: | $this->flightDate = $object->flightDate; |
252: | } |
253: | if (property_exists($object, 'flightLegs')) { |
254: | if (!is_array($object->flightLegs) && !is_object($object->flightLegs)) { |
255: | throw new UnexpectedValueException('value \'' . print_r($object->flightLegs, true) . '\' is not an array or object'); |
256: | } |
257: | $this->flightLegs = []; |
258: | foreach ($object->flightLegs as $element) { |
259: | $value = new AirlineFlightLeg(); |
260: | $this->flightLegs[] = $value->fromObject($element); |
261: | } |
262: | } |
263: | if (property_exists($object, 'invoiceNumber')) { |
264: | $this->invoiceNumber = $object->invoiceNumber; |
265: | } |
266: | if (property_exists($object, 'isETicket')) { |
267: | $this->isETicket = $object->isETicket; |
268: | } |
269: | if (property_exists($object, 'isRegisteredCustomer')) { |
270: | $this->isRegisteredCustomer = $object->isRegisteredCustomer; |
271: | } |
272: | if (property_exists($object, 'isRestrictedTicket')) { |
273: | $this->isRestrictedTicket = $object->isRestrictedTicket; |
274: | } |
275: | if (property_exists($object, 'isThirdParty')) { |
276: | $this->isThirdParty = $object->isThirdParty; |
277: | } |
278: | if (property_exists($object, 'issueDate')) { |
279: | $this->issueDate = $object->issueDate; |
280: | } |
281: | if (property_exists($object, 'merchantCustomerId')) { |
282: | $this->merchantCustomerId = $object->merchantCustomerId; |
283: | } |
284: | if (property_exists($object, 'name')) { |
285: | $this->name = $object->name; |
286: | } |
287: | if (property_exists($object, 'numberInParty')) { |
288: | $this->numberInParty = $object->numberInParty; |
289: | } |
290: | if (property_exists($object, 'passengerName')) { |
291: | $this->passengerName = $object->passengerName; |
292: | } |
293: | if (property_exists($object, 'passengers')) { |
294: | if (!is_array($object->passengers) && !is_object($object->passengers)) { |
295: | throw new UnexpectedValueException('value \'' . print_r($object->passengers, true) . '\' is not an array or object'); |
296: | } |
297: | $this->passengers = []; |
298: | foreach ($object->passengers as $element) { |
299: | $value = new AirlinePassenger(); |
300: | $this->passengers[] = $value->fromObject($element); |
301: | } |
302: | } |
303: | if (property_exists($object, 'placeOfIssue')) { |
304: | $this->placeOfIssue = $object->placeOfIssue; |
305: | } |
306: | if (property_exists($object, 'pnr')) { |
307: | $this->pnr = $object->pnr; |
308: | } |
309: | if (property_exists($object, 'pointOfSale')) { |
310: | $this->pointOfSale = $object->pointOfSale; |
311: | } |
312: | if (property_exists($object, 'posCityCode')) { |
313: | $this->posCityCode = $object->posCityCode; |
314: | } |
315: | if (property_exists($object, 'ticketDeliveryMethod')) { |
316: | $this->ticketDeliveryMethod = $object->ticketDeliveryMethod; |
317: | } |
318: | if (property_exists($object, 'ticketNumber')) { |
319: | $this->ticketNumber = $object->ticketNumber; |
320: | } |
321: | if (property_exists($object, 'totalFare')) { |
322: | $this->totalFare = $object->totalFare; |
323: | } |
324: | if (property_exists($object, 'totalFee')) { |
325: | $this->totalFee = $object->totalFee; |
326: | } |
327: | if (property_exists($object, 'totalTaxes')) { |
328: | $this->totalTaxes = $object->totalTaxes; |
329: | } |
330: | if (property_exists($object, 'travelAgencyName')) { |
331: | $this->travelAgencyName = $object->travelAgencyName; |
332: | } |
333: | return $this; |
334: | } |
335: | } |
336: | |