-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
ContactLists.php
44 lines (38 loc) · 1.02 KB
/
ContactLists.php
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
<?php
declare(strict_types=1);
namespace SmartEmailing\v3\Models\Holder;
use SmartEmailing\v3\Models\AbstractMapHolder;
use SmartEmailing\v3\Models\ContactListStatus;
use SmartEmailing\v3\Models\Model;
/**
* @extends AbstractMapHolder<ContactListStatus>
*/
class ContactLists extends AbstractMapHolder
{
/**
* Inserts contact list into the items. Unique items only.
*
* @return $this
*/
public function add(ContactListStatus $list): self
{
$this->insertEntry($list);
return $this;
}
/**
* Creates ContactList entry and inserts it to the array
*
* @param string|null $status Contact's status in Contactlist. Allowed values: "confirmed", "unsubscribed",
* "removed"
*/
public function create(int $id, ?string $status = null): ContactListStatus
{
$list = new ContactListStatus($id, $status);
$this->add($list);
return $list;
}
protected function entryKey(Model $entry): ?int
{
return $entry->getId();
}
}