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