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 OrderLineDetails extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $discountAmount = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $googleProductCategoryId = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $lineAmountTotal = null; |
30: | |
31: | |
32: | |
33: | |
34: | public $naicsCommodityCode = null; |
35: | |
36: | |
37: | |
38: | |
39: | public $productCategory = null; |
40: | |
41: | |
42: | |
43: | |
44: | public $productCode = null; |
45: | |
46: | |
47: | |
48: | |
49: | public $productName = null; |
50: | |
51: | |
52: | |
53: | |
54: | public $productPrice = null; |
55: | |
56: | |
57: | |
58: | |
59: | public $productSku = null; |
60: | |
61: | |
62: | |
63: | |
64: | public $productType = null; |
65: | |
66: | |
67: | |
68: | |
69: | public $quantity = null; |
70: | |
71: | |
72: | |
73: | |
74: | public $taxAmount = null; |
75: | |
76: | |
77: | |
78: | |
79: | public $unit = null; |
80: | |
81: | |
82: | |
83: | |
84: | public function toObject() |
85: | { |
86: | $object = parent::toObject(); |
87: | if (!is_null($this->discountAmount)) { |
88: | $object->discountAmount = $this->discountAmount; |
89: | } |
90: | if (!is_null($this->googleProductCategoryId)) { |
91: | $object->googleProductCategoryId = $this->googleProductCategoryId; |
92: | } |
93: | if (!is_null($this->lineAmountTotal)) { |
94: | $object->lineAmountTotal = $this->lineAmountTotal; |
95: | } |
96: | if (!is_null($this->naicsCommodityCode)) { |
97: | $object->naicsCommodityCode = $this->naicsCommodityCode; |
98: | } |
99: | if (!is_null($this->productCategory)) { |
100: | $object->productCategory = $this->productCategory; |
101: | } |
102: | if (!is_null($this->productCode)) { |
103: | $object->productCode = $this->productCode; |
104: | } |
105: | if (!is_null($this->productName)) { |
106: | $object->productName = $this->productName; |
107: | } |
108: | if (!is_null($this->productPrice)) { |
109: | $object->productPrice = $this->productPrice; |
110: | } |
111: | if (!is_null($this->productSku)) { |
112: | $object->productSku = $this->productSku; |
113: | } |
114: | if (!is_null($this->productType)) { |
115: | $object->productType = $this->productType; |
116: | } |
117: | if (!is_null($this->quantity)) { |
118: | $object->quantity = $this->quantity; |
119: | } |
120: | if (!is_null($this->taxAmount)) { |
121: | $object->taxAmount = $this->taxAmount; |
122: | } |
123: | if (!is_null($this->unit)) { |
124: | $object->unit = $this->unit; |
125: | } |
126: | return $object; |
127: | } |
128: | |
129: | |
130: | |
131: | |
132: | |
133: | |
134: | public function fromObject($object) |
135: | { |
136: | parent::fromObject($object); |
137: | if (property_exists($object, 'discountAmount')) { |
138: | $this->discountAmount = $object->discountAmount; |
139: | } |
140: | if (property_exists($object, 'googleProductCategoryId')) { |
141: | $this->googleProductCategoryId = $object->googleProductCategoryId; |
142: | } |
143: | if (property_exists($object, 'lineAmountTotal')) { |
144: | $this->lineAmountTotal = $object->lineAmountTotal; |
145: | } |
146: | if (property_exists($object, 'naicsCommodityCode')) { |
147: | $this->naicsCommodityCode = $object->naicsCommodityCode; |
148: | } |
149: | if (property_exists($object, 'productCategory')) { |
150: | $this->productCategory = $object->productCategory; |
151: | } |
152: | if (property_exists($object, 'productCode')) { |
153: | $this->productCode = $object->productCode; |
154: | } |
155: | if (property_exists($object, 'productName')) { |
156: | $this->productName = $object->productName; |
157: | } |
158: | if (property_exists($object, 'productPrice')) { |
159: | $this->productPrice = $object->productPrice; |
160: | } |
161: | if (property_exists($object, 'productSku')) { |
162: | $this->productSku = $object->productSku; |
163: | } |
164: | if (property_exists($object, 'productType')) { |
165: | $this->productType = $object->productType; |
166: | } |
167: | if (property_exists($object, 'quantity')) { |
168: | $this->quantity = $object->quantity; |
169: | } |
170: | if (property_exists($object, 'taxAmount')) { |
171: | $this->taxAmount = $object->taxAmount; |
172: | } |
173: | if (property_exists($object, 'unit')) { |
174: | $this->unit = $object->unit; |
175: | } |
176: | return $this; |
177: | } |
178: | } |
179: | |