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