1 | <?php |
||
5 | class Member |
||
6 | { |
||
7 | public $id; |
||
8 | public $listId; |
||
9 | public $email; |
||
10 | public $state; |
||
11 | public $signupDate; |
||
12 | public $modified; |
||
13 | public $ip; |
||
14 | public $sourceUrl; |
||
15 | private $customFields = []; |
||
16 | |||
17 | const STATE_ACTIVE = 'active'; |
||
18 | const STATE_UNSUBSCRIBED = 'unsubscribed'; |
||
19 | const STATE_CLEANED = 'cleaned'; |
||
20 | |||
21 | const STATES = [self::STATE_ACTIVE, self::STATE_UNSUBSCRIBED, self::STATE_CLEANED]; |
||
22 | |||
23 | /** |
||
24 | * @param array $response |
||
25 | * @return Member |
||
26 | */ |
||
27 | public static function createFromResponse(array $response) : Member |
||
35 | |||
36 | /** |
||
37 | * @param array $response |
||
38 | */ |
||
39 | public function updateFromResponse(array $response) |
||
52 | |||
53 | /** |
||
54 | * @return array |
||
55 | */ |
||
56 | public function getCustomFields() : array |
||
60 | |||
61 | /** |
||
62 | * @param array|null $customFields |
||
63 | */ |
||
64 | public function setCustomFields($customFields) |
||
70 | |||
71 | /** |
||
72 | * @param $key |
||
73 | * @param $value |
||
74 | */ |
||
75 | public function setCustomField($key, $value) |
||
79 | |||
80 | /** |
||
81 | * @param $key |
||
82 | * @return mixed |
||
83 | */ |
||
84 | public function getCustomField($key) |
||
88 | } |
||
89 |