This repository was archived by the owner on Dec 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathAddress.php
More file actions
103 lines (89 loc) · 2.32 KB
/
Copy pathAddress.php
File metadata and controls
103 lines (89 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
namespace YousafSaqib\ConstantContact\Components\Contacts;
use YousafSaqib\ConstantContact\Components\Component;
/**
* Represents a single Address of a Contact
*
* @package Components
* @subpackage Contacts
* @author Constant Contact
*/
class Address extends Component
{
/**
* Id of the address
* @var string
*/
public $id;
/**
* Line 1 of the address
* @var string
*/
public $line1;
/**
* Line 2 of the address
* @var string
*/
public $line2;
/**
* Line 3 of the address
* @var string
*/
public $line3;
/**
* City info for this address
* @var string
*/
public $city;
/**
* Address type, must be one of "BUSINESS", "PERSONAL", or "UNKNOWN"
* @var string
*/
public $address_type;
/**
* The state code for this address
* @var string
*/
public $state_code;
/**
* The state for this address (non-US/Canada)
*
*/
public $state;
/**
* The country code for this address
* @var string
*/
public $country_code;
/**
* The postal code for this address
* @var string
*/
public $postal_code;
/**
* The sub postal code for this address
* @var string
*/
public $sub_postal_code;
/**
* Factory method to create an Address object from an array
* @param array $props - Associative array of initial properties to set
* @return Address
*/
public static function create(array $props)
{
$address = new Address();
$address->id = parent::getValue($props, "id");
$address->line1 = parent::getValue($props, "line1");
$address->line2 = parent::getValue($props, "line2");
$address->line3 = parent::getValue($props, "line3");
$address->city = parent::getValue($props, "city");
$address->address_type = parent::getValue($props, "address_type");
$address->state_code = parent::getValue($props, "state_code");
$address->state = parent::getValue($props, "state");
$address->country_code = parent::getValue($props, "country_code");
$address->postal_code = parent::getValue($props, "postal_code");
$address->sub_postal_code = parent::getValue($props, "sub_postal_code");
return $address;
}
}