| 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 PaymentProduct840SpecificOutput extends DataObject |
| 15: | { |
| 16: | |
| 17: | |
| 18: | |
| 19: | public $billingAddress = null; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | public $customerAccount = null; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | public $customerAddress = null; |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public $protectionEligibility = null; |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public function toObject() |
| 40: | { |
| 41: | $object = parent::toObject(); |
| 42: | if (!is_null($this->billingAddress)) { |
| 43: | $object->billingAddress = $this->billingAddress->toObject(); |
| 44: | } |
| 45: | if (!is_null($this->customerAccount)) { |
| 46: | $object->customerAccount = $this->customerAccount->toObject(); |
| 47: | } |
| 48: | if (!is_null($this->customerAddress)) { |
| 49: | $object->customerAddress = $this->customerAddress->toObject(); |
| 50: | } |
| 51: | if (!is_null($this->protectionEligibility)) { |
| 52: | $object->protectionEligibility = $this->protectionEligibility->toObject(); |
| 53: | } |
| 54: | return $object; |
| 55: | } |
| 56: | |
| 57: | |
| 58: | |
| 59: | |
| 60: | |
| 61: | |
| 62: | public function fromObject($object) |
| 63: | { |
| 64: | parent::fromObject($object); |
| 65: | if (property_exists($object, 'billingAddress')) { |
| 66: | if (!is_object($object->billingAddress)) { |
| 67: | throw new UnexpectedValueException('value \'' . print_r($object->billingAddress, true) . '\' is not an object'); |
| 68: | } |
| 69: | $value = new Address(); |
| 70: | $this->billingAddress = $value->fromObject($object->billingAddress); |
| 71: | } |
| 72: | if (property_exists($object, 'customerAccount')) { |
| 73: | if (!is_object($object->customerAccount)) { |
| 74: | throw new UnexpectedValueException('value \'' . print_r($object->customerAccount, true) . '\' is not an object'); |
| 75: | } |
| 76: | $value = new PaymentProduct840CustomerAccount(); |
| 77: | $this->customerAccount = $value->fromObject($object->customerAccount); |
| 78: | } |
| 79: | if (property_exists($object, 'customerAddress')) { |
| 80: | if (!is_object($object->customerAddress)) { |
| 81: | throw new UnexpectedValueException('value \'' . print_r($object->customerAddress, true) . '\' is not an object'); |
| 82: | } |
| 83: | $value = new Address(); |
| 84: | $this->customerAddress = $value->fromObject($object->customerAddress); |
| 85: | } |
| 86: | if (property_exists($object, 'protectionEligibility')) { |
| 87: | if (!is_object($object->protectionEligibility)) { |
| 88: | throw new UnexpectedValueException('value \'' . print_r($object->protectionEligibility, true) . '\' is not an object'); |
| 89: | } |
| 90: | $value = new ProtectionEligibility(); |
| 91: | $this->protectionEligibility = $value->fromObject($object->protectionEligibility); |
| 92: | } |
| 93: | return $this; |
| 94: | } |
| 95: | } |
| 96: | |