| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | namespace Worldline\Acquiring\Sdk\V1\Domain; |
| 6: | |
| 7: | use UnexpectedValueException; |
| 8: | use Worldline\Acquiring\Sdk\Domain\DataObject; |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | class ServiceLocationAddress extends DataObject |
| 14: | { |
| 15: | |
| 16: | |
| 17: | |
| 18: | public $city = null; |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | public $countryCode = null; |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | public $countrySubdivisionCode = null; |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: | public $postalCode = null; |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | public function toObject() |
| 39: | { |
| 40: | $object = parent::toObject(); |
| 41: | if (!is_null($this->city)) { |
| 42: | $object->city = $this->city; |
| 43: | } |
| 44: | if (!is_null($this->countryCode)) { |
| 45: | $object->countryCode = $this->countryCode; |
| 46: | } |
| 47: | if (!is_null($this->countrySubdivisionCode)) { |
| 48: | $object->countrySubdivisionCode = $this->countrySubdivisionCode; |
| 49: | } |
| 50: | if (!is_null($this->postalCode)) { |
| 51: | $object->postalCode = $this->postalCode; |
| 52: | } |
| 53: | return $object; |
| 54: | } |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | |
| 60: | |
| 61: | public function fromObject($object) |
| 62: | { |
| 63: | parent::fromObject($object); |
| 64: | if (property_exists($object, 'city')) { |
| 65: | $this->city = $object->city; |
| 66: | } |
| 67: | if (property_exists($object, 'countryCode')) { |
| 68: | $this->countryCode = $object->countryCode; |
| 69: | } |
| 70: | if (property_exists($object, 'countrySubdivisionCode')) { |
| 71: | $this->countrySubdivisionCode = $object->countrySubdivisionCode; |
| 72: | } |
| 73: | if (property_exists($object, 'postalCode')) { |
| 74: | $this->postalCode = $object->postalCode; |
| 75: | } |
| 76: | return $this; |
| 77: | } |
| 78: | } |
| 79: | |