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 MandateCustomer extends DataObject
15: {
16: /**
17: * @var BankAccountIban
18: */
19: public $bankAccountIban = null;
20:
21: /**
22: * @var string
23: */
24: public $companyName = null;
25:
26: /**
27: * @var MandateContactDetails
28: */
29: public $contactDetails = null;
30:
31: /**
32: * @var MandateAddress
33: */
34: public $mandateAddress = null;
35:
36: /**
37: * @var MandatePersonalInformation
38: */
39: public $personalInformation = null;
40:
41: /**
42: * @return object
43: */
44: public function toObject()
45: {
46: $object = parent::toObject();
47: if (!is_null($this->bankAccountIban)) {
48: $object->bankAccountIban = $this->bankAccountIban->toObject();
49: }
50: if (!is_null($this->companyName)) {
51: $object->companyName = $this->companyName;
52: }
53: if (!is_null($this->contactDetails)) {
54: $object->contactDetails = $this->contactDetails->toObject();
55: }
56: if (!is_null($this->mandateAddress)) {
57: $object->mandateAddress = $this->mandateAddress->toObject();
58: }
59: if (!is_null($this->personalInformation)) {
60: $object->personalInformation = $this->personalInformation->toObject();
61: }
62: return $object;
63: }
64:
65: /**
66: * @param object $object
67: * @return $this
68: * @throws UnexpectedValueException
69: */
70: public function fromObject($object)
71: {
72: parent::fromObject($object);
73: if (property_exists($object, 'bankAccountIban')) {
74: if (!is_object($object->bankAccountIban)) {
75: throw new UnexpectedValueException('value \'' . print_r($object->bankAccountIban, true) . '\' is not an object');
76: }
77: $value = new BankAccountIban();
78: $this->bankAccountIban = $value->fromObject($object->bankAccountIban);
79: }
80: if (property_exists($object, 'companyName')) {
81: $this->companyName = $object->companyName;
82: }
83: if (property_exists($object, 'contactDetails')) {
84: if (!is_object($object->contactDetails)) {
85: throw new UnexpectedValueException('value \'' . print_r($object->contactDetails, true) . '\' is not an object');
86: }
87: $value = new MandateContactDetails();
88: $this->contactDetails = $value->fromObject($object->contactDetails);
89: }
90: if (property_exists($object, 'mandateAddress')) {
91: if (!is_object($object->mandateAddress)) {
92: throw new UnexpectedValueException('value \'' . print_r($object->mandateAddress, true) . '\' is not an object');
93: }
94: $value = new MandateAddress();
95: $this->mandateAddress = $value->fromObject($object->mandateAddress);
96: }
97: if (property_exists($object, 'personalInformation')) {
98: if (!is_object($object->personalInformation)) {
99: throw new UnexpectedValueException('value \'' . print_r($object->personalInformation, true) . '\' is not an object');
100: }
101: $value = new MandatePersonalInformation();
102: $this->personalInformation = $value->fromObject($object->personalInformation);
103: }
104: return $this;
105: }
106: }
107: