| 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 Address extends DataObject |
| 15: | { |
| 16: | |
| 17: | |
| 18: | |
| 19: | public $additionalInfo = null; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | public $city = null; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | public $countryCode = null; |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public $houseNumber = null; |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public $state = null; |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public $stateCode = null; |
| 45: | |
| 46: | |
| 47: | |
| 48: | |
| 49: | public $street = null; |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | public $zip = null; |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | public function toObject() |
| 60: | { |
| 61: | $object = parent::toObject(); |
| 62: | if (!is_null($this->additionalInfo)) { |
| 63: | $object->additionalInfo = $this->additionalInfo; |
| 64: | } |
| 65: | if (!is_null($this->city)) { |
| 66: | $object->city = $this->city; |
| 67: | } |
| 68: | if (!is_null($this->countryCode)) { |
| 69: | $object->countryCode = $this->countryCode; |
| 70: | } |
| 71: | if (!is_null($this->houseNumber)) { |
| 72: | $object->houseNumber = $this->houseNumber; |
| 73: | } |
| 74: | if (!is_null($this->state)) { |
| 75: | $object->state = $this->state; |
| 76: | } |
| 77: | if (!is_null($this->stateCode)) { |
| 78: | $object->stateCode = $this->stateCode; |
| 79: | } |
| 80: | if (!is_null($this->street)) { |
| 81: | $object->street = $this->street; |
| 82: | } |
| 83: | if (!is_null($this->zip)) { |
| 84: | $object->zip = $this->zip; |
| 85: | } |
| 86: | return $object; |
| 87: | } |
| 88: | |
| 89: | |
| 90: | |
| 91: | |
| 92: | |
| 93: | |
| 94: | public function fromObject($object) |
| 95: | { |
| 96: | parent::fromObject($object); |
| 97: | if (property_exists($object, 'additionalInfo')) { |
| 98: | $this->additionalInfo = $object->additionalInfo; |
| 99: | } |
| 100: | if (property_exists($object, 'city')) { |
| 101: | $this->city = $object->city; |
| 102: | } |
| 103: | if (property_exists($object, 'countryCode')) { |
| 104: | $this->countryCode = $object->countryCode; |
| 105: | } |
| 106: | if (property_exists($object, 'houseNumber')) { |
| 107: | $this->houseNumber = $object->houseNumber; |
| 108: | } |
| 109: | if (property_exists($object, 'state')) { |
| 110: | $this->state = $object->state; |
| 111: | } |
| 112: | if (property_exists($object, 'stateCode')) { |
| 113: | $this->stateCode = $object->stateCode; |
| 114: | } |
| 115: | if (property_exists($object, 'street')) { |
| 116: | $this->street = $object->street; |
| 117: | } |
| 118: | if (property_exists($object, 'zip')) { |
| 119: | $this->zip = $object->zip; |
| 120: | } |
| 121: | return $this; |
| 122: | } |
| 123: | } |
| 124: | |