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