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: | class PaymentProductFieldDisplayHints extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $alwaysShow = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $displayOrder = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $formElement = null; |
30: | |
31: | |
32: | |
33: | |
34: | public $label = null; |
35: | |
36: | |
37: | |
38: | |
39: | public $link = null; |
40: | |
41: | |
42: | |
43: | |
44: | public $mask = null; |
45: | |
46: | |
47: | |
48: | |
49: | public $obfuscate = null; |
50: | |
51: | |
52: | |
53: | |
54: | public $placeholderLabel = null; |
55: | |
56: | |
57: | |
58: | |
59: | public $preferredInputType = null; |
60: | |
61: | |
62: | |
63: | |
64: | public $tooltip = null; |
65: | |
66: | |
67: | |
68: | |
69: | public function toObject() |
70: | { |
71: | $object = parent::toObject(); |
72: | if (!is_null($this->alwaysShow)) { |
73: | $object->alwaysShow = $this->alwaysShow; |
74: | } |
75: | if (!is_null($this->displayOrder)) { |
76: | $object->displayOrder = $this->displayOrder; |
77: | } |
78: | if (!is_null($this->formElement)) { |
79: | $object->formElement = $this->formElement->toObject(); |
80: | } |
81: | if (!is_null($this->label)) { |
82: | $object->label = $this->label; |
83: | } |
84: | if (!is_null($this->link)) { |
85: | $object->link = $this->link; |
86: | } |
87: | if (!is_null($this->mask)) { |
88: | $object->mask = $this->mask; |
89: | } |
90: | if (!is_null($this->obfuscate)) { |
91: | $object->obfuscate = $this->obfuscate; |
92: | } |
93: | if (!is_null($this->placeholderLabel)) { |
94: | $object->placeholderLabel = $this->placeholderLabel; |
95: | } |
96: | if (!is_null($this->preferredInputType)) { |
97: | $object->preferredInputType = $this->preferredInputType; |
98: | } |
99: | if (!is_null($this->tooltip)) { |
100: | $object->tooltip = $this->tooltip->toObject(); |
101: | } |
102: | return $object; |
103: | } |
104: | |
105: | |
106: | |
107: | |
108: | |
109: | |
110: | public function fromObject($object) |
111: | { |
112: | parent::fromObject($object); |
113: | if (property_exists($object, 'alwaysShow')) { |
114: | $this->alwaysShow = $object->alwaysShow; |
115: | } |
116: | if (property_exists($object, 'displayOrder')) { |
117: | $this->displayOrder = $object->displayOrder; |
118: | } |
119: | if (property_exists($object, 'formElement')) { |
120: | if (!is_object($object->formElement)) { |
121: | throw new UnexpectedValueException('value \'' . print_r($object->formElement, true) . '\' is not an object'); |
122: | } |
123: | $value = new PaymentProductFieldFormElement(); |
124: | $this->formElement = $value->fromObject($object->formElement); |
125: | } |
126: | if (property_exists($object, 'label')) { |
127: | $this->label = $object->label; |
128: | } |
129: | if (property_exists($object, 'link')) { |
130: | $this->link = $object->link; |
131: | } |
132: | if (property_exists($object, 'mask')) { |
133: | $this->mask = $object->mask; |
134: | } |
135: | if (property_exists($object, 'obfuscate')) { |
136: | $this->obfuscate = $object->obfuscate; |
137: | } |
138: | if (property_exists($object, 'placeholderLabel')) { |
139: | $this->placeholderLabel = $object->placeholderLabel; |
140: | } |
141: | if (property_exists($object, 'preferredInputType')) { |
142: | $this->preferredInputType = $object->preferredInputType; |
143: | } |
144: | if (property_exists($object, 'tooltip')) { |
145: | if (!is_object($object->tooltip)) { |
146: | throw new UnexpectedValueException('value \'' . print_r($object->tooltip, true) . '\' is not an object'); |
147: | } |
148: | $value = new PaymentProductFieldTooltip(); |
149: | $this->tooltip = $value->fromObject($object->tooltip); |
150: | } |
151: | return $this; |
152: | } |
153: | } |
154: | |