1: <?php
2: /*
3: * This class was auto-generated from the API references found at
4: * https://apireference.connect.worldline-solutions.com/
5: */
6: namespace Worldline\Connect\Sdk\V1\Domain;
7:
8: use UnexpectedValueException;
9: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class MandateSepaDirectDebitWithoutCreditor extends DataObject
15: {
16: /**
17: * @var BankAccountIban|null
18: */
19: public ?BankAccountIban $bankAccountIban = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $customerContractIdentifier = null;
25:
26: /**
27: * @var Debtor|null
28: */
29: public ?Debtor $debtor = null;
30:
31: /**
32: * @var bool|null
33: */
34: public ?bool $isRecurring = null;
35:
36: /**
37: * @var MandateApproval|null
38: */
39: public ?MandateApproval $mandateApproval = null;
40:
41: /**
42: * @var string|null
43: */
44: public ?string $preNotification = null;
45:
46: /**
47: * @return object
48: */
49: public function toObject(): object
50: {
51: $object = parent::toObject();
52: if (!is_null($this->bankAccountIban)) {
53: $object->bankAccountIban = $this->bankAccountIban->toObject();
54: }
55: if (!is_null($this->customerContractIdentifier)) {
56: $object->customerContractIdentifier = $this->customerContractIdentifier;
57: }
58: if (!is_null($this->debtor)) {
59: $object->debtor = $this->debtor->toObject();
60: }
61: if (!is_null($this->isRecurring)) {
62: $object->isRecurring = $this->isRecurring;
63: }
64: if (!is_null($this->mandateApproval)) {
65: $object->mandateApproval = $this->mandateApproval->toObject();
66: }
67: if (!is_null($this->preNotification)) {
68: $object->preNotification = $this->preNotification;
69: }
70: return $object;
71: }
72:
73: /**
74: * @param object $object
75: *
76: * @return $this
77: * @throws UnexpectedValueException
78: */
79: public function fromObject(object $object): MandateSepaDirectDebitWithoutCreditor
80: {
81: parent::fromObject($object);
82: if (property_exists($object, 'bankAccountIban')) {
83: if (!is_object($object->bankAccountIban)) {
84: throw new UnexpectedValueException('value \'' . print_r($object->bankAccountIban, true) . '\' is not an object');
85: }
86: $value = new BankAccountIban();
87: $this->bankAccountIban = $value->fromObject($object->bankAccountIban);
88: }
89: if (property_exists($object, 'customerContractIdentifier')) {
90: $this->customerContractIdentifier = $object->customerContractIdentifier;
91: }
92: if (property_exists($object, 'debtor')) {
93: if (!is_object($object->debtor)) {
94: throw new UnexpectedValueException('value \'' . print_r($object->debtor, true) . '\' is not an object');
95: }
96: $value = new Debtor();
97: $this->debtor = $value->fromObject($object->debtor);
98: }
99: if (property_exists($object, 'isRecurring')) {
100: $this->isRecurring = $object->isRecurring;
101: }
102: if (property_exists($object, 'mandateApproval')) {
103: if (!is_object($object->mandateApproval)) {
104: throw new UnexpectedValueException('value \'' . print_r($object->mandateApproval, true) . '\' is not an object');
105: }
106: $value = new MandateApproval();
107: $this->mandateApproval = $value->fromObject($object->mandateApproval);
108: }
109: if (property_exists($object, 'preNotification')) {
110: $this->preNotification = $object->preNotification;
111: }
112: return $this;
113: }
114: }
115: