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 | const STATE_DELETED = 'deleted'; |
||
21 | |||
22 | const STATES = [ |
||
23 | self::STATE_ACTIVE, |
||
24 | self::STATE_UNSUBSCRIBED, |
||
25 | self::STATE_CLEANED, |
||
26 | self::STATE_DELETED, |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * @param array $response |
||
31 | * @return Member |
||
32 | */ |
||
33 | public static function createFromResponse(array $response): self |
||
41 | |||
42 | /** |
||
43 | * @param array $response |
||
44 | */ |
||
45 | public function updateFromResponse(array $response) |
||
58 | |||
59 | /** |
||
60 | * @return array |
||
61 | */ |
||
62 | public function getCustomFields(): array |
||
66 | |||
67 | /** |
||
68 | * @param array|null $customFields |
||
69 | */ |
||
70 | public function setCustomFields($customFields) |
||
76 | |||
77 | /** |
||
78 | * @param $key |
||
79 | * @param $value |
||
80 | */ |
||
81 | public function setCustomField($key, $value) |
||
85 | |||
86 | /** |
||
87 | * @param $key |
||
88 | * @return mixed |
||
89 | */ |
||
90 | public function getCustomField($key) |
||
94 | } |
||
95 |