@@ -69,13 +69,8 @@ public function __construct(\SimpleXMLElement $xmlDoc)
69
69
$ this ->buildingName = isset ($ xmlDoc ->BuildingName ) ? (string )$ xmlDoc ->BuildingName : '' ;
70
70
if (isset ($ xmlDoc ->AddressLine )) {
71
71
for ($ i = 0 , $ len = count ($ xmlDoc ->AddressLine ); $ i < $ len ; $ i ++) {
72
- if ($ i === 0 ) {
73
- $ this ->addressLine = isset ($ xmlDoc ->AddressLine [$ i ]) ? (string ) $ xmlDoc ->AddressLine [$ i ] : '' ;
74
- } elseif ($ i === 1 ) {
75
- $ this ->addressLine2 = isset ($ xmlDoc ->AddressLine [$ i ]) ? (string ) $ xmlDoc ->AddressLine [$ i ] : '' ;
76
- } elseif ($ i === 2 ) {
77
- $ this ->addressLine3 = isset ($ xmlDoc ->AddressLine [$ i ]) ? (string ) $ xmlDoc ->AddressLine [$ i ] : '' ;
78
- }
72
+ $ var = 'addressLine ' . ($ i > 0 ? $ i + 1 : '' );
73
+ $ this ->{$ var } = isset ($ xmlDoc ->AddressLine [$ i ]) ? (string ) $ xmlDoc ->AddressLine [$ i ] : '' ;
79
74
}
80
75
}
81
76
$ this ->region = isset ($ xmlDoc ->Region ) ? (string )$ xmlDoc ->Region : '' ;
@@ -101,6 +96,38 @@ public function getCity()
101
96
return $ this ->politicalDivision2 ;
102
97
}
103
98
99
+ /**
100
+ * @return string
101
+ */
102
+ public function getRegion ()
103
+ {
104
+ return $ this ->region ;
105
+ }
106
+
107
+ /**
108
+ * @return string
109
+ */
110
+ public function getConsigneeName ()
111
+ {
112
+ return $ this ->consigneeName ;
113
+ }
114
+
115
+ /**
116
+ * @return string
117
+ */
118
+ public function getUrbanization ()
119
+ {
120
+ return $ this ->urbanization ;
121
+ }
122
+
123
+ /**
124
+ * @return string
125
+ */
126
+ public function getBuildingName ()
127
+ {
128
+ return $ this ->buildingName ;
129
+ }
130
+
104
131
/**
105
132
* @return string
106
133
*/
@@ -129,4 +156,16 @@ public function getPostalCodeWithExtension($divider = '-')
129
156
{
130
157
return $ this ->postcodePrimaryLow . $ divider . $ this ->postcodeExtendedLow ;
131
158
}
159
+
160
+ /**
161
+ * @return string
162
+ *
163
+ * @param int $lineNumber
164
+ * @return string
165
+ */
166
+ public function getAddressLine ($ lineNumber = 1 )
167
+ {
168
+ $ var = 'addressLine ' . ($ lineNumber > 1 ? $ lineNumber : '' );
169
+ return $ this ->{$ var };
170
+ }
132
171
}
0 commit comments