forked from pionl/smart-emailing-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomFields.php
41 lines (38 loc) · 1.22 KB
/
CustomFields.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
<?php
namespace SmartEmailing\v3\Request\Import\Holder;
use SmartEmailing\v3\Models\AbstractMapHolder;
use SmartEmailing\v3\Request\Import\CustomField;
class CustomFields extends AbstractMapHolder
{
/**
* Inserts custom filed into the items. Unique items only.
*
* @param CustomField $list
*
* @return $this
*/
public function add(CustomField $list)
{
$this->insertEntry($list);
return $this;
}
/**
* Creates ContactList entry and inserts it to the array
*
* @param int $id
* @param string|null $value String value for simple customfields, and YYYY-MM-DD HH:MM:SS for date customfields.
* Value size is limited to
* 64KB. Required for simple customfields
* @param array $options Array of Customfields options IDs matching with selected Customfield. Required for
* composite customfields
*
* @return CustomField
*/
public function create($id, $value = null, $options = [])
{
$field = new CustomField($id, $value);
$field->setOptions($options);
$this->add($field);
return $field;
}
}