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 DirectoryEntry extends DataObject
15: {
16: /**
17: * @var string[]|null
18: */
19: public ?array $countryNames = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $issuerId = null;
25:
26: /**
27: * @var string|null
28: */
29: public ?string $issuerList = null;
30:
31: /**
32: * @var string|null
33: */
34: public ?string $issuerName = null;
35:
36: /**
37: * @return object
38: */
39: public function toObject(): object
40: {
41: $object = parent::toObject();
42: if (!is_null($this->countryNames)) {
43: $object->countryNames = [];
44: foreach ($this->countryNames as $element) {
45: if (!is_null($element)) {
46: $object->countryNames[] = $element;
47: }
48: }
49: }
50: if (!is_null($this->issuerId)) {
51: $object->issuerId = $this->issuerId;
52: }
53: if (!is_null($this->issuerList)) {
54: $object->issuerList = $this->issuerList;
55: }
56: if (!is_null($this->issuerName)) {
57: $object->issuerName = $this->issuerName;
58: }
59: return $object;
60: }
61:
62: /**
63: * @param object $object
64: *
65: * @return $this
66: * @throws UnexpectedValueException
67: */
68: public function fromObject(object $object): DirectoryEntry
69: {
70: parent::fromObject($object);
71: if (property_exists($object, 'countryNames')) {
72: if (!is_array($object->countryNames) && !is_object($object->countryNames)) {
73: throw new UnexpectedValueException('value \'' . print_r($object->countryNames, true) . '\' is not an array or object');
74: }
75: $this->countryNames = [];
76: foreach ($object->countryNames as $element) {
77: $this->countryNames[] = $element;
78: }
79: }
80: if (property_exists($object, 'issuerId')) {
81: $this->issuerId = $object->issuerId;
82: }
83: if (property_exists($object, 'issuerList')) {
84: $this->issuerList = $object->issuerList;
85: }
86: if (property_exists($object, 'issuerName')) {
87: $this->issuerName = $object->issuerName;
88: }
89: return $this;
90: }
91: }
92: