| 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 PaymentProductFieldValidators extends DataObject |
| 15: | { |
| 16: | |
| 17: | |
| 18: | |
| 19: | public $boletoBancarioRequiredness = null; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | public $emailAddress = null; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | public $expirationDate = null; |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public $fixedList = null; |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public $iban = null; |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public $length = null; |
| 45: | |
| 46: | |
| 47: | |
| 48: | |
| 49: | public $luhn = null; |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | public $range = null; |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | public $regularExpression = null; |
| 60: | |
| 61: | |
| 62: | |
| 63: | |
| 64: | public $residentIdNumber = null; |
| 65: | |
| 66: | |
| 67: | |
| 68: | |
| 69: | public $termsAndConditions = null; |
| 70: | |
| 71: | |
| 72: | |
| 73: | |
| 74: | public function toObject() |
| 75: | { |
| 76: | $object = parent::toObject(); |
| 77: | if (!is_null($this->boletoBancarioRequiredness)) { |
| 78: | $object->boletoBancarioRequiredness = $this->boletoBancarioRequiredness->toObject(); |
| 79: | } |
| 80: | if (!is_null($this->emailAddress)) { |
| 81: | $object->emailAddress = $this->emailAddress->toObject(); |
| 82: | } |
| 83: | if (!is_null($this->expirationDate)) { |
| 84: | $object->expirationDate = $this->expirationDate->toObject(); |
| 85: | } |
| 86: | if (!is_null($this->fixedList)) { |
| 87: | $object->fixedList = $this->fixedList->toObject(); |
| 88: | } |
| 89: | if (!is_null($this->iban)) { |
| 90: | $object->iban = $this->iban->toObject(); |
| 91: | } |
| 92: | if (!is_null($this->length)) { |
| 93: | $object->length = $this->length->toObject(); |
| 94: | } |
| 95: | if (!is_null($this->luhn)) { |
| 96: | $object->luhn = $this->luhn->toObject(); |
| 97: | } |
| 98: | if (!is_null($this->range)) { |
| 99: | $object->range = $this->range->toObject(); |
| 100: | } |
| 101: | if (!is_null($this->regularExpression)) { |
| 102: | $object->regularExpression = $this->regularExpression->toObject(); |
| 103: | } |
| 104: | if (!is_null($this->residentIdNumber)) { |
| 105: | $object->residentIdNumber = $this->residentIdNumber->toObject(); |
| 106: | } |
| 107: | if (!is_null($this->termsAndConditions)) { |
| 108: | $object->termsAndConditions = $this->termsAndConditions->toObject(); |
| 109: | } |
| 110: | return $object; |
| 111: | } |
| 112: | |
| 113: | |
| 114: | |
| 115: | |
| 116: | |
| 117: | |
| 118: | public function fromObject($object) |
| 119: | { |
| 120: | parent::fromObject($object); |
| 121: | if (property_exists($object, 'boletoBancarioRequiredness')) { |
| 122: | if (!is_object($object->boletoBancarioRequiredness)) { |
| 123: | throw new UnexpectedValueException('value \'' . print_r($object->boletoBancarioRequiredness, true) . '\' is not an object'); |
| 124: | } |
| 125: | $value = new BoletoBancarioRequirednessValidator(); |
| 126: | $this->boletoBancarioRequiredness = $value->fromObject($object->boletoBancarioRequiredness); |
| 127: | } |
| 128: | if (property_exists($object, 'emailAddress')) { |
| 129: | if (!is_object($object->emailAddress)) { |
| 130: | throw new UnexpectedValueException('value \'' . print_r($object->emailAddress, true) . '\' is not an object'); |
| 131: | } |
| 132: | $value = new EmptyValidator(); |
| 133: | $this->emailAddress = $value->fromObject($object->emailAddress); |
| 134: | } |
| 135: | if (property_exists($object, 'expirationDate')) { |
| 136: | if (!is_object($object->expirationDate)) { |
| 137: | throw new UnexpectedValueException('value \'' . print_r($object->expirationDate, true) . '\' is not an object'); |
| 138: | } |
| 139: | $value = new EmptyValidator(); |
| 140: | $this->expirationDate = $value->fromObject($object->expirationDate); |
| 141: | } |
| 142: | if (property_exists($object, 'fixedList')) { |
| 143: | if (!is_object($object->fixedList)) { |
| 144: | throw new UnexpectedValueException('value \'' . print_r($object->fixedList, true) . '\' is not an object'); |
| 145: | } |
| 146: | $value = new FixedListValidator(); |
| 147: | $this->fixedList = $value->fromObject($object->fixedList); |
| 148: | } |
| 149: | if (property_exists($object, 'iban')) { |
| 150: | if (!is_object($object->iban)) { |
| 151: | throw new UnexpectedValueException('value \'' . print_r($object->iban, true) . '\' is not an object'); |
| 152: | } |
| 153: | $value = new EmptyValidator(); |
| 154: | $this->iban = $value->fromObject($object->iban); |
| 155: | } |
| 156: | if (property_exists($object, 'length')) { |
| 157: | if (!is_object($object->length)) { |
| 158: | throw new UnexpectedValueException('value \'' . print_r($object->length, true) . '\' is not an object'); |
| 159: | } |
| 160: | $value = new LengthValidator(); |
| 161: | $this->length = $value->fromObject($object->length); |
| 162: | } |
| 163: | if (property_exists($object, 'luhn')) { |
| 164: | if (!is_object($object->luhn)) { |
| 165: | throw new UnexpectedValueException('value \'' . print_r($object->luhn, true) . '\' is not an object'); |
| 166: | } |
| 167: | $value = new EmptyValidator(); |
| 168: | $this->luhn = $value->fromObject($object->luhn); |
| 169: | } |
| 170: | if (property_exists($object, 'range')) { |
| 171: | if (!is_object($object->range)) { |
| 172: | throw new UnexpectedValueException('value \'' . print_r($object->range, true) . '\' is not an object'); |
| 173: | } |
| 174: | $value = new RangeValidator(); |
| 175: | $this->range = $value->fromObject($object->range); |
| 176: | } |
| 177: | if (property_exists($object, 'regularExpression')) { |
| 178: | if (!is_object($object->regularExpression)) { |
| 179: | throw new UnexpectedValueException('value \'' . print_r($object->regularExpression, true) . '\' is not an object'); |
| 180: | } |
| 181: | $value = new RegularExpressionValidator(); |
| 182: | $this->regularExpression = $value->fromObject($object->regularExpression); |
| 183: | } |
| 184: | if (property_exists($object, 'residentIdNumber')) { |
| 185: | if (!is_object($object->residentIdNumber)) { |
| 186: | throw new UnexpectedValueException('value \'' . print_r($object->residentIdNumber, true) . '\' is not an object'); |
| 187: | } |
| 188: | $value = new EmptyValidator(); |
| 189: | $this->residentIdNumber = $value->fromObject($object->residentIdNumber); |
| 190: | } |
| 191: | if (property_exists($object, 'termsAndConditions')) { |
| 192: | if (!is_object($object->termsAndConditions)) { |
| 193: | throw new UnexpectedValueException('value \'' . print_r($object->termsAndConditions, true) . '\' is not an object'); |
| 194: | } |
| 195: | $value = new EmptyValidator(); |
| 196: | $this->termsAndConditions = $value->fromObject($object->termsAndConditions); |
| 197: | } |
| 198: | return $this; |
| 199: | } |
| 200: | } |
| 201: | |