| @@ 12-32 (lines=21) @@ | ||
| 9 | /** |
|
| 10 | * @author Ibrahim Hizeoui <[email protected]> |
|
| 11 | */ |
|
| 12 | class BusinessAddress extends BaseAddress |
|
| 13 | { |
|
| 14 | /** |
|
| 15 | * Create an API response object from the HTTP response from the API server. |
|
| 16 | * |
|
| 17 | * @param array $data |
|
| 18 | * |
|
| 19 | * @return self |
|
| 20 | */ |
|
| 21 | public static function createFromArray(array $data) |
|
| 22 | { |
|
| 23 | $businessAddress = new self(); |
|
| 24 | $businessAddress->careOf = $data['careof'] ?? null; |
|
| 25 | $businessAddress->streetAddress = $data['street_address'] ?? null; |
|
| 26 | $businessAddress->zipCode = $data['zipcode'] ?? null; |
|
| 27 | $businessAddress->city = $data['city'] ?? null; |
|
| 28 | $businessAddress->country = $data['country'] ?? null; |
|
| 29 | ||
| 30 | return $businessAddress; |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 12-32 (lines=21) @@ | ||
| 9 | /** |
|
| 10 | * @author Ibrahim Hizeoui <[email protected]> |
|
| 11 | */ |
|
| 12 | class VisitingAddress extends BaseAddress |
|
| 13 | { |
|
| 14 | /** |
|
| 15 | * Create an API response object from the HTTP response from the API server. |
|
| 16 | * |
|
| 17 | * @param array $data |
|
| 18 | * |
|
| 19 | * @return self |
|
| 20 | */ |
|
| 21 | public static function createFromArray(array $data) |
|
| 22 | { |
|
| 23 | $visitingAddress = new self(); |
|
| 24 | $visitingAddress->careOf = $data['careof'] ?? null; |
|
| 25 | $visitingAddress->streetAddress = $data['street_address'] ?? null; |
|
| 26 | $visitingAddress->zipCode = $data['zipcode'] ?? null; |
|
| 27 | $visitingAddress->city = $data['city'] ?? null; |
|
| 28 | $visitingAddress->country = $data['country'] ?? null; |
|
| 29 | ||
| 30 | return $visitingAddress; |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||