| 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: | |
| 15: | |
| 16: | class LoanRecipient extends DataObject |
| 17: | { |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | public ?string $accountNumber = null; |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | |
| 30: | public ?string $dateOfBirth = null; |
| 31: | |
| 32: | |
| 33: | |
| 34: | |
| 35: | |
| 36: | |
| 37: | public ?string $partialPan = null; |
| 38: | |
| 39: | |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public ?string $surname = null; |
| 45: | |
| 46: | |
| 47: | |
| 48: | |
| 49: | |
| 50: | |
| 51: | public ?string $zip = null; |
| 52: | |
| 53: | |
| 54: | |
| 55: | |
| 56: | public function toObject(): object |
| 57: | { |
| 58: | $object = parent::toObject(); |
| 59: | if (!is_null($this->accountNumber)) { |
| 60: | $object->accountNumber = $this->accountNumber; |
| 61: | } |
| 62: | if (!is_null($this->dateOfBirth)) { |
| 63: | $object->dateOfBirth = $this->dateOfBirth; |
| 64: | } |
| 65: | if (!is_null($this->partialPan)) { |
| 66: | $object->partialPan = $this->partialPan; |
| 67: | } |
| 68: | if (!is_null($this->surname)) { |
| 69: | $object->surname = $this->surname; |
| 70: | } |
| 71: | if (!is_null($this->zip)) { |
| 72: | $object->zip = $this->zip; |
| 73: | } |
| 74: | return $object; |
| 75: | } |
| 76: | |
| 77: | |
| 78: | |
| 79: | |
| 80: | |
| 81: | |
| 82: | |
| 83: | public function fromObject(object $object): LoanRecipient |
| 84: | { |
| 85: | parent::fromObject($object); |
| 86: | if (property_exists($object, 'accountNumber')) { |
| 87: | $this->accountNumber = $object->accountNumber; |
| 88: | } |
| 89: | if (property_exists($object, 'dateOfBirth')) { |
| 90: | $this->dateOfBirth = $object->dateOfBirth; |
| 91: | } |
| 92: | if (property_exists($object, 'partialPan')) { |
| 93: | $this->partialPan = $object->partialPan; |
| 94: | } |
| 95: | if (property_exists($object, 'surname')) { |
| 96: | $this->surname = $object->surname; |
| 97: | } |
| 98: | if (property_exists($object, 'zip')) { |
| 99: | $this->zip = $object->zip; |
| 100: | } |
| 101: | return $this; |
| 102: | } |
| 103: | } |
| 104: | |