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:
10: /**
11: * @package Worldline\Connect\Sdk\V1\Domain
12: */
13: class ContactDetails extends ContactDetailsBase
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $faxNumber = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $mobilePhoneNumber = null;
24:
25: /**
26: * @var string|null
27: */
28: public ?string $phoneNumber = null;
29:
30: /**
31: * @var string|null
32: */
33: public ?string $workPhoneNumber = null;
34:
35: /**
36: * @return object
37: */
38: public function toObject(): object
39: {
40: $object = parent::toObject();
41: if (!is_null($this->faxNumber)) {
42: $object->faxNumber = $this->faxNumber;
43: }
44: if (!is_null($this->mobilePhoneNumber)) {
45: $object->mobilePhoneNumber = $this->mobilePhoneNumber;
46: }
47: if (!is_null($this->phoneNumber)) {
48: $object->phoneNumber = $this->phoneNumber;
49: }
50: if (!is_null($this->workPhoneNumber)) {
51: $object->workPhoneNumber = $this->workPhoneNumber;
52: }
53: return $object;
54: }
55:
56: /**
57: * @param object $object
58: *
59: * @return $this
60: * @throws UnexpectedValueException
61: */
62: public function fromObject(object $object): ContactDetails
63: {
64: parent::fromObject($object);
65: if (property_exists($object, 'faxNumber')) {
66: $this->faxNumber = $object->faxNumber;
67: }
68: if (property_exists($object, 'mobilePhoneNumber')) {
69: $this->mobilePhoneNumber = $object->mobilePhoneNumber;
70: }
71: if (property_exists($object, 'phoneNumber')) {
72: $this->phoneNumber = $object->phoneNumber;
73: }
74: if (property_exists($object, 'workPhoneNumber')) {
75: $this->workPhoneNumber = $object->workPhoneNumber;
76: }
77: return $this;
78: }
79: }
80: