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 AdditionalOrderInput extends DataObject
15: {
16: /**
17: * @var AccountFundingRecipient
18: */
19: public $accountFundingRecipient = null;
20:
21: /**
22: * @var AirlineData
23: */
24: public $airlineData = null;
25:
26: /**
27: * @var Installments
28: */
29: public $installments = null;
30:
31: /**
32: * @var Level3SummaryData
33: * @deprecated Use Order.shoppingCart.amountBreakdown instead
34: */
35: public $level3SummaryData = null;
36:
37: /**
38: * @var LoanRecipient
39: * @deprecated No replacement
40: */
41: public $loanRecipient = null;
42:
43: /**
44: * @var LodgingData
45: */
46: public $lodgingData = null;
47:
48: /**
49: * @var int
50: * @deprecated Use installments.numberOfInstallments instead
51: */
52: public $numberOfInstallments = null;
53:
54: /**
55: * @var string
56: */
57: public $orderDate = null;
58:
59: /**
60: * @var OrderTypeInformation
61: */
62: public $typeInformation = null;
63:
64: /**
65: * @return object
66: */
67: public function toObject()
68: {
69: $object = parent::toObject();
70: if (!is_null($this->accountFundingRecipient)) {
71: $object->accountFundingRecipient = $this->accountFundingRecipient->toObject();
72: }
73: if (!is_null($this->airlineData)) {
74: $object->airlineData = $this->airlineData->toObject();
75: }
76: if (!is_null($this->installments)) {
77: $object->installments = $this->installments->toObject();
78: }
79: if (!is_null($this->level3SummaryData)) {
80: $object->level3SummaryData = $this->level3SummaryData->toObject();
81: }
82: if (!is_null($this->loanRecipient)) {
83: $object->loanRecipient = $this->loanRecipient->toObject();
84: }
85: if (!is_null($this->lodgingData)) {
86: $object->lodgingData = $this->lodgingData->toObject();
87: }
88: if (!is_null($this->numberOfInstallments)) {
89: $object->numberOfInstallments = $this->numberOfInstallments;
90: }
91: if (!is_null($this->orderDate)) {
92: $object->orderDate = $this->orderDate;
93: }
94: if (!is_null($this->typeInformation)) {
95: $object->typeInformation = $this->typeInformation->toObject();
96: }
97: return $object;
98: }
99:
100: /**
101: * @param object $object
102: * @return $this
103: * @throws UnexpectedValueException
104: */
105: public function fromObject($object)
106: {
107: parent::fromObject($object);
108: if (property_exists($object, 'accountFundingRecipient')) {
109: if (!is_object($object->accountFundingRecipient)) {
110: throw new UnexpectedValueException('value \'' . print_r($object->accountFundingRecipient, true) . '\' is not an object');
111: }
112: $value = new AccountFundingRecipient();
113: $this->accountFundingRecipient = $value->fromObject($object->accountFundingRecipient);
114: }
115: if (property_exists($object, 'airlineData')) {
116: if (!is_object($object->airlineData)) {
117: throw new UnexpectedValueException('value \'' . print_r($object->airlineData, true) . '\' is not an object');
118: }
119: $value = new AirlineData();
120: $this->airlineData = $value->fromObject($object->airlineData);
121: }
122: if (property_exists($object, 'installments')) {
123: if (!is_object($object->installments)) {
124: throw new UnexpectedValueException('value \'' . print_r($object->installments, true) . '\' is not an object');
125: }
126: $value = new Installments();
127: $this->installments = $value->fromObject($object->installments);
128: }
129: if (property_exists($object, 'level3SummaryData')) {
130: if (!is_object($object->level3SummaryData)) {
131: throw new UnexpectedValueException('value \'' . print_r($object->level3SummaryData, true) . '\' is not an object');
132: }
133: $value = new Level3SummaryData();
134: $this->level3SummaryData = $value->fromObject($object->level3SummaryData);
135: }
136: if (property_exists($object, 'loanRecipient')) {
137: if (!is_object($object->loanRecipient)) {
138: throw new UnexpectedValueException('value \'' . print_r($object->loanRecipient, true) . '\' is not an object');
139: }
140: $value = new LoanRecipient();
141: $this->loanRecipient = $value->fromObject($object->loanRecipient);
142: }
143: if (property_exists($object, 'lodgingData')) {
144: if (!is_object($object->lodgingData)) {
145: throw new UnexpectedValueException('value \'' . print_r($object->lodgingData, true) . '\' is not an object');
146: }
147: $value = new LodgingData();
148: $this->lodgingData = $value->fromObject($object->lodgingData);
149: }
150: if (property_exists($object, 'numberOfInstallments')) {
151: $this->numberOfInstallments = $object->numberOfInstallments;
152: }
153: if (property_exists($object, 'orderDate')) {
154: $this->orderDate = $object->orderDate;
155: }
156: if (property_exists($object, 'typeInformation')) {
157: if (!is_object($object->typeInformation)) {
158: throw new UnexpectedValueException('value \'' . print_r($object->typeInformation, true) . '\' is not an object');
159: }
160: $value = new OrderTypeInformation();
161: $this->typeInformation = $value->fromObject($object->typeInformation);
162: }
163: return $this;
164: }
165: }
166: