| 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 $productImageUrl = null; |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | public $productName = null; |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | public $productPrice = null; |
| 60: | |
| 61: | |
| 62: | |
| 63: | |
| 64: | public $productSku = null; |
| 65: | |
| 66: | |
| 67: | |
| 68: | |
| 69: | public $productType = null; |
| 70: | |
| 71: | |
| 72: | |
| 73: | |
| 74: | public $productUrl = null; |
| 75: | |
| 76: | |
| 77: | |
| 78: | |
| 79: | public $quantity = null; |
| 80: | |
| 81: | |
| 82: | |
| 83: | |
| 84: | public $taxAmount = null; |
| 85: | |
| 86: | |
| 87: | |
| 88: | |
| 89: | public $unit = null; |
| 90: | |
| 91: | |
| 92: | |
| 93: | |
| 94: | public function toObject() |
| 95: | { |
| 96: | $object = parent::toObject(); |
| 97: | if (!is_null($this->discountAmount)) { |
| 98: | $object->discountAmount = $this->discountAmount; |
| 99: | } |
| 100: | if (!is_null($this->googleProductCategoryId)) { |
| 101: | $object->googleProductCategoryId = $this->googleProductCategoryId; |
| 102: | } |
| 103: | if (!is_null($this->lineAmountTotal)) { |
| 104: | $object->lineAmountTotal = $this->lineAmountTotal; |
| 105: | } |
| 106: | if (!is_null($this->naicsCommodityCode)) { |
| 107: | $object->naicsCommodityCode = $this->naicsCommodityCode; |
| 108: | } |
| 109: | if (!is_null($this->productCategory)) { |
| 110: | $object->productCategory = $this->productCategory; |
| 111: | } |
| 112: | if (!is_null($this->productCode)) { |
| 113: | $object->productCode = $this->productCode; |
| 114: | } |
| 115: | if (!is_null($this->productImageUrl)) { |
| 116: | $object->productImageUrl = $this->productImageUrl; |
| 117: | } |
| 118: | if (!is_null($this->productName)) { |
| 119: | $object->productName = $this->productName; |
| 120: | } |
| 121: | if (!is_null($this->productPrice)) { |
| 122: | $object->productPrice = $this->productPrice; |
| 123: | } |
| 124: | if (!is_null($this->productSku)) { |
| 125: | $object->productSku = $this->productSku; |
| 126: | } |
| 127: | if (!is_null($this->productType)) { |
| 128: | $object->productType = $this->productType; |
| 129: | } |
| 130: | if (!is_null($this->productUrl)) { |
| 131: | $object->productUrl = $this->productUrl; |
| 132: | } |
| 133: | if (!is_null($this->quantity)) { |
| 134: | $object->quantity = $this->quantity; |
| 135: | } |
| 136: | if (!is_null($this->taxAmount)) { |
| 137: | $object->taxAmount = $this->taxAmount; |
| 138: | } |
| 139: | if (!is_null($this->unit)) { |
| 140: | $object->unit = $this->unit; |
| 141: | } |
| 142: | return $object; |
| 143: | } |
| 144: | |
| 145: | |
| 146: | |
| 147: | |
| 148: | |
| 149: | |
| 150: | public function fromObject($object) |
| 151: | { |
| 152: | parent::fromObject($object); |
| 153: | if (property_exists($object, 'discountAmount')) { |
| 154: | $this->discountAmount = $object->discountAmount; |
| 155: | } |
| 156: | if (property_exists($object, 'googleProductCategoryId')) { |
| 157: | $this->googleProductCategoryId = $object->googleProductCategoryId; |
| 158: | } |
| 159: | if (property_exists($object, 'lineAmountTotal')) { |
| 160: | $this->lineAmountTotal = $object->lineAmountTotal; |
| 161: | } |
| 162: | if (property_exists($object, 'naicsCommodityCode')) { |
| 163: | $this->naicsCommodityCode = $object->naicsCommodityCode; |
| 164: | } |
| 165: | if (property_exists($object, 'productCategory')) { |
| 166: | $this->productCategory = $object->productCategory; |
| 167: | } |
| 168: | if (property_exists($object, 'productCode')) { |
| 169: | $this->productCode = $object->productCode; |
| 170: | } |
| 171: | if (property_exists($object, 'productImageUrl')) { |
| 172: | $this->productImageUrl = $object->productImageUrl; |
| 173: | } |
| 174: | if (property_exists($object, 'productName')) { |
| 175: | $this->productName = $object->productName; |
| 176: | } |
| 177: | if (property_exists($object, 'productPrice')) { |
| 178: | $this->productPrice = $object->productPrice; |
| 179: | } |
| 180: | if (property_exists($object, 'productSku')) { |
| 181: | $this->productSku = $object->productSku; |
| 182: | } |
| 183: | if (property_exists($object, 'productType')) { |
| 184: | $this->productType = $object->productType; |
| 185: | } |
| 186: | if (property_exists($object, 'productUrl')) { |
| 187: | $this->productUrl = $object->productUrl; |
| 188: | } |
| 189: | if (property_exists($object, 'quantity')) { |
| 190: | $this->quantity = $object->quantity; |
| 191: | } |
| 192: | if (property_exists($object, 'taxAmount')) { |
| 193: | $this->taxAmount = $object->taxAmount; |
| 194: | } |
| 195: | if (property_exists($object, 'unit')) { |
| 196: | $this->unit = $object->unit; |
| 197: | } |
| 198: | return $this; |
| 199: | } |
| 200: | } |
| 201: | |