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 pathEmailAddress.php
More file actions
85 lines (73 loc) · 2.25 KB
/
EmailAddress.php
File metadata and controls
85 lines (73 loc) · 2.25 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
<?php
namespace YousafSaqib\ConstantContact\Components\Contacts;
use YousafSaqib\ConstantContact\Components\Component;
/**
* Represents a single EmailAddress of a Contact
*
* @package Components
* @subpackage Contacts
* @author Constant Contact
*/
class EmailAddress extends Component
{
/**
* Id of the email address
* @var string
*/
public $id;
/**
* Status of the email address, must be one of "ACTIVE", "UNCONFIRMED", "OPTOUT", "REMOVED",
* "NON_SUBSCRIBER", "VISITOR"
* @var string
*/
public $status;
/**
* Contact's confirmation status, must be one of "CONFIRMED", "NO_CONFIRMATION_REQUIRED", "UNCONFIRMED"
* @var string
*/
public $confirm_status;
/**
* Contact's opt in source, must be one of "ACTION_BY_VISITOR", "ACTION_BY_OWNER"
* @var string
*/
public $opt_in_source;
/**
* Contact's opt in date in ISO 8601 format
* @var string
*/
public $opt_in_date;
/**
* Contact's opt out date in ISO 8601 format
* @var string
*/
public $opt_out_date;
/**
* Email address associated with the contact
* @var string
*/
public $email_address;
public function __construct($email_address = null)
{
if (!is_null($email_address)) {
$this->email_address = $email_address;
}
return $this;
}
/**
* Factory method to create an EmailAddress object from an array
* @param array $props - Associative array of initial properties to set
* @return EmailAddress
*/
public static function create(array $props)
{
$email_address = new EmailAddress();
$email_address->id = parent::getValue($props, "id");
$email_address->status = parent::getValue($props, "status");
$email_address->confirm_status = parent::getValue($props, "confirm_status");
$email_address->opt_in_source = parent::getValue($props, "opt_in_source");
$email_address->opt_in_date = parent::getValue($props, "opt_in_date");
$email_address->opt_out_date = parent::getValue($props, "opt_out_date");
$email_address->email_address = parent::getValue($props, "email_address");
return $email_address;
}
}