1 <?php
2 /* --------------------------------------------------------------
3 CustomerAddress.inc.php 2015-02-18 gm
4 Gambio GmbH
5 http://www.gambio.de
6 Copyright (c) 2014 Gambio GmbH
7 Released under the GNU General Public License (Version 2)
8 [http://www.gnu.org/licenses/gpl-2.0.html]
9 --------------------------------------------------------------
10 */
11
12 MainFactory::load_class('CustomerAddressInterface');
13
14 /**
15 * Class CustomerAddress
16 *
17 * This class is used for managing customer address data
18 *
19 * @category System
20 * @package Customer
21 * @subpackage Address
22 * @implements CustomerAddressInterface
23 */
24 class CustomerAddress implements CustomerAddressInterface
25 {
26 /**
27 * @var int
28 */
29 protected $id;
30
31 /**
32 * @var int
33 */
34 protected $customerId;
35
36 /**
37 * @var CustomerGenderInterface
38 */
39 protected $gender;
40
41 /**
42 * @var CustomerFirstnameInterface
43 */
44 protected $firstname;
45
46 /**
47 * @var CustomerLastnameInterface
48 */
49 protected $lastname;
50
51 /**
52 * @var CustomerCompanyInterface
53 */
54 protected $company;
55
56 /**
57 * @var CustomerStreetInterface
58 */
59 protected $street;
60
61 /**
62 * @var CustomerSuburbInterface
63 */
64 protected $suburb;
65
66 /**
67 * @var CustomerPostcodeInterface
68 */
69 protected $postcode;
70
71 /**
72 * @var CustomerCityInterface
73 */
74 protected $city;
75
76 /**
77 * @var CustomerCountryInterface
78 */
79 protected $country;
80
81 /**
82 * @var CustomerCountryZoneInterface
83 */
84 protected $countryZone;
85
86 /**
87 * @var AddressClassInterface
88 */
89 protected $addressClass;
90
91 /**
92 * @var CustomerB2BStatusInterface
93 */
94 protected $b2bStatus;
95
96
97 /**
98 * Import Address Block
99 *
100 * This method will import all address parts from the address block
101 *
102 * @param AddressBlockInterface $addressBlock
103 */
104 public function importAddressBlock(AddressBlockInterface $addressBlock)
105 {
106 $this->setGender($addressBlock->getGender());
107 $this->setFirstname($addressBlock->getFirstname());
108 $this->setLastname($addressBlock->getLastname());
109 $this->setCompany($addressBlock->getCompany());
110 $this->setB2BStatus($addressBlock->getB2BStatus());
111 $this->setStreet($addressBlock->getStreet());
112 $this->setSuburb($addressBlock->getSuburb());
113 $this->setPostcode($addressBlock->getPostcode());
114 $this->setCity($addressBlock->getCity());
115 $this->setCountry($addressBlock->getCountry());
116 $this->setCountryZone($addressBlock->getCountryZone());
117 }
118
119
120 /**
121 * Setter method for the ID
122 *
123 * @param IdType $id addressBookId
124 */
125 public function setId(IdType $id)
126 {
127 $this->id = (int)(string)$id;
128 }
129
130
131 /**
132 * Setter method for the customer ID
133 *
134 * @param IdType $customerId
135 */
136 public function setCustomerId(IdType $customerId)
137 {
138 $this->customerId = (int)(string)$customerId;
139 }
140
141
142 /**
143 * Getter method for the customer ID
144 *
145 * @return int
146 */
147 public function getCustomerId()
148 {
149 return $this->customerId;
150 }
151
152
153 /**
154 * Getter method for the ID
155 *
156 * @return int | null
157 */
158 public function getId()
159 {
160 return $this->id;
161 }
162
163
164 /**
165 * Setter method for the city
166 *
167 * @param CustomerCityInterface $city
168 */
169 public function setCity(CustomerCityInterface $city)
170 {
171 $this->city = $city;
172 }
173
174
175 /**
176 * Getter method for the city
177 *
178 * @return CustomerCityInterface
179 */
180 public function getCity()
181 {
182 return $this->city;
183 }
184
185
186 /**
187 * Setter method for the country
188 *
189 * @param CustomerCountryInterface $country
190 */
191 public function setCountry(CustomerCountryInterface $country)
192 {
193 $this->country = $country;
194 }
195
196
197 /**
198 * Getter method for the country
199 *
200 * @return CustomerCountryInterface
201 */
202 public function getCountry()
203 {
204 return $this->country;
205 }
206
207
208 /**
209 * Setter method for the country zone
210 *
211 * @param CustomerCountryZoneInterface $countryZone
212 */
213 public function setCountryZone(CustomerCountryZoneInterface $countryZone)
214 {
215 $this->countryZone = $countryZone;
216 }
217
218
219 /**
220 * Getter method for the country zone
221 *
222 * @return CustomerCountryZoneInterface
223 */
224 public function getCountryZone()
225 {
226 return $this->countryZone;
227 }
228
229
230 /**
231 * Setter method for the first name of the customer
232 *
233 * @param CustomerFirstnameInterface $firstname
234 */
235 public function setFirstname(CustomerFirstnameInterface $firstname)
236 {
237 $this->firstname = $firstname;
238 }
239
240
241 /**
242 * Getter method for the first name of the customer
243 *
244 * @return CustomerFirstnameInterface
245 */
246 public function getFirstname()
247 {
248 return $this->firstname;
249 }
250
251
252 /**
253 * Setter method for the gender of the customer
254 *
255 * @param CustomerGenderInterface
256 */
257 public function setGender(CustomerGenderInterface $gender)
258 {
259 $this->gender = $gender;
260 }
261
262
263 /**
264 * Getter method for the gender of the customer
265 *
266 * @return CustomerGenderInterface
267 */
268 public function getGender()
269 {
270 return $this->gender;
271 }
272
273
274 /**
275 * Setter method for the last name of the customer
276 *
277 * @param CustomerLastnameInterface $lastname
278 */
279 public function setLastname(CustomerLastnameInterface $lastname)
280 {
281 $this->lastname = $lastname;
282 }
283
284
285 /**
286 * Getter method for the last name of the customer
287 *
288 * @return CustomerLastnameInterface
289 */
290 public function getLastname()
291 {
292 return $this->lastname;
293 }
294
295
296 /**
297 * Setter method for the postcode
298 *
299 * @param CustomerPostcodeInterface $postcode
300 */
301 public function setPostcode(CustomerPostcodeInterface $postcode)
302 {
303 $this->postcode = $postcode;
304 }
305
306
307 /**
308 * Getter method for the postcode
309 *
310 * @return CustomerPostcodeInterface
311 */
312 public function getPostcode()
313 {
314 return $this->postcode;
315 }
316
317
318 /**
319 * Setter method for the street name
320 *
321 * @param CustomerStreetInterface $street
322 */
323 public function setStreet(CustomerStreetInterface $street)
324 {
325 $this->street = $street;
326 }
327
328
329 /**
330 * Getter method for the street name
331 *
332 * @return CustomerStreetInterface
333 */
334 public function getStreet()
335 {
336 return $this->street;
337 }
338
339
340 /**
341 * Setter method for the company name
342 *
343 * @param CustomerCompanyInterface $company
344 */
345 public function setCompany(CustomerCompanyInterface $company)
346 {
347 $this->company = $company;
348 }
349
350
351 /**
352 * Getter method for the company name
353 *
354 * @return CustomerCompanyInterface
355 */
356 public function getCompany()
357 {
358 return $this->company;
359 }
360
361
362 /**
363 * Setter method for the suburb
364 *
365 * @param CustomerSuburbInterface $suburb
366 */
367 public function setSuburb(CustomerSuburbInterface $suburb)
368 {
369 $this->suburb = $suburb;
370 }
371
372
373 /**
374 * Getter method of the suburb
375 *
376 * @return CustomerSuburbInterface
377 */
378 public function getSuburb()
379 {
380 return $this->suburb;
381 }
382
383
384 /**
385 * Setter method for the address class
386 *
387 * @param AddressClassInterface $addressClass
388 */
389 public function setAddressClass(AddressClassInterface $addressClass)
390 {
391 $this->addressClass = $addressClass;
392 }
393
394
395 /**
396 * Getter method of the address class
397 *
398 * @return AddressClassInterface
399 */
400 public function getAddressClass()
401 {
402 return $this->addressClass;
403 }
404
405
406 /**
407 * Setter method for the address class
408 *
409 * @param CustomerB2BStatusInterface $b2bStatus
410 */
411 public function setB2BStatus(CustomerB2BStatusInterface $b2bStatus)
412 {
413 $this->b2bStatus = $b2bStatus;
414 }
415
416
417 /**
418 * Getter method of the address class
419 *
420 * @return CustomerB2BStatusInterface
421 */
422 public function getB2BStatus()
423 {
424 return $this->b2bStatus;
425 }
426 }