| 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 ?bool $alwaysShow = null; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | public ?int $displayOrder = null; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | public ?PaymentProductFieldFormElement $formElement = null; |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public ?string $label = null; |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public ?string $link = null; |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public ?string $mask = null; |
| 45: | |
| 46: | |
| 47: | |
| 48: | |
| 49: | public ?bool $obfuscate = null; |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | public ?string $placeholderLabel = null; |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | public ?string $preferredInputType = null; |
| 60: | |
| 61: | |
| 62: | |
| 63: | |
| 64: | public ?PaymentProductFieldTooltip $tooltip = null; |
| 65: | |
| 66: | |
| 67: | |
| 68: | |
| 69: | public function toObject(): object |
| 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: | |
| 111: | public function fromObject(object $object): PaymentProductFieldDisplayHints |
| 112: | { |
| 113: | parent::fromObject($object); |
| 114: | if (property_exists($object, 'alwaysShow')) { |
| 115: | $this->alwaysShow = $object->alwaysShow; |
| 116: | } |
| 117: | if (property_exists($object, 'displayOrder')) { |
| 118: | $this->displayOrder = $object->displayOrder; |
| 119: | } |
| 120: | if (property_exists($object, 'formElement')) { |
| 121: | if (!is_object($object->formElement)) { |
| 122: | throw new UnexpectedValueException('value \'' . print_r($object->formElement, true) . '\' is not an object'); |
| 123: | } |
| 124: | $value = new PaymentProductFieldFormElement(); |
| 125: | $this->formElement = $value->fromObject($object->formElement); |
| 126: | } |
| 127: | if (property_exists($object, 'label')) { |
| 128: | $this->label = $object->label; |
| 129: | } |
| 130: | if (property_exists($object, 'link')) { |
| 131: | $this->link = $object->link; |
| 132: | } |
| 133: | if (property_exists($object, 'mask')) { |
| 134: | $this->mask = $object->mask; |
| 135: | } |
| 136: | if (property_exists($object, 'obfuscate')) { |
| 137: | $this->obfuscate = $object->obfuscate; |
| 138: | } |
| 139: | if (property_exists($object, 'placeholderLabel')) { |
| 140: | $this->placeholderLabel = $object->placeholderLabel; |
| 141: | } |
| 142: | if (property_exists($object, 'preferredInputType')) { |
| 143: | $this->preferredInputType = $object->preferredInputType; |
| 144: | } |
| 145: | if (property_exists($object, 'tooltip')) { |
| 146: | if (!is_object($object->tooltip)) { |
| 147: | throw new UnexpectedValueException('value \'' . print_r($object->tooltip, true) . '\' is not an object'); |
| 148: | } |
| 149: | $value = new PaymentProductFieldTooltip(); |
| 150: | $this->tooltip = $value->fromObject($object->tooltip); |
| 151: | } |
| 152: | return $this; |
| 153: | } |
| 154: | } |
| 155: | |