1 | <?php |
||
9 | trait ManagesLists |
||
10 | { |
||
11 | use Action; |
||
12 | |||
13 | /** |
||
14 | * Returns all lists. |
||
15 | * |
||
16 | * @return ContactsList[] |
||
17 | */ |
||
18 | public function lists() |
||
26 | |||
27 | /** |
||
28 | * Returns list by ID. |
||
29 | * |
||
30 | * @param string $id |
||
31 | * |
||
32 | * @return ContactsList|null |
||
33 | */ |
||
34 | public function getList($id) |
||
47 | |||
48 | /** |
||
49 | * Finds list by it's name or URL-safe name. |
||
50 | * |
||
51 | * @param string $name name of list to find |
||
52 | * |
||
53 | * @return null|ContactsList |
||
54 | */ |
||
55 | public function findList($name) |
||
65 | |||
66 | /** |
||
67 | * Creates a new list. |
||
68 | * |
||
69 | * @param string $name Name of the list to create |
||
70 | * @param string $senderUrl The website URL this list is for. |
||
71 | * @param array $params other options to create list |
||
72 | * |
||
73 | * @return ContactsList |
||
74 | */ |
||
75 | public function createList($name, $senderUrl, $params = []) |
||
91 | |||
92 | /** |
||
93 | * Removes list. |
||
94 | * |
||
95 | * @param int $id ID of the list to delete |
||
96 | * |
||
97 | * @throws \TestMonitor\ActiveCampaign\Exceptions\NotFoundException |
||
98 | */ |
||
99 | public function deleteList($id) |
||
103 | |||
104 | /** |
||
105 | * Subscribe a contact to a list or unsubscribe a contact from a list. |
||
106 | * |
||
107 | * @param int $list ID of list to remove contact from |
||
108 | * @param int $contact ID of contact to remove from list |
||
109 | * @param bool $subscribe TRUE to subscribe, FALSE otherwise |
||
110 | */ |
||
111 | public function updateListStatus($list, $contact, $subscribe) |
||
120 | |||
121 | /** |
||
122 | * Get all contacts related to the list. |
||
123 | * |
||
124 | * @return Contact[] |
||
125 | */ |
||
126 | public function contactsByList($listId) |
||
134 | } |
||
135 |