This repository was archived by the owner on Dec 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathContactList.php
More file actions
executable file
·77 lines (66 loc) · 1.84 KB
/
ContactList.php
File metadata and controls
executable file
·77 lines (66 loc) · 1.84 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
namespace Ctct\Components\Contacts;
use Ctct\Components\Component;
/**
* Represents a single Contact List
*
* @package Components
* @subpackage Contacts
* @author Constant Contact
*/
class ContactList extends Component {
/**
* Unique identifier of the contact list
* @var string
*/
public $id;
/**
* Name of the contact list
* @var string
*/
public $name;
/**
* Status of the contact list, must be one of "ACTIVE", "HIDDEN", "REMOVED"
* @var string
*/
public $status;
/**
* The number of contacts in the list
* @var string
*/
public $contact_count;
/**
* Date and time the list was created.
* @var string
*/
public $created_date;
/**
* Date and time the list was last modified.
* @var string
*/
public $modified_date;
public function __construct($list_id = null) {
if (!is_null($list_id)) {
$this->id = $list_id;
}
return $this;
}
/**
* Factory method to create a ContactList object from an array
* @param array $props - Associative array of initial properties to set
* @return ContactList
*/
public static function create(array $props) {
$contact_list = new ContactList();
$contact_list->id = parent::getValue($props, "list_id");
$contact_list->name = parent::getValue($props, "name");
$contact_list->status = parent::getValue($props, "status");
$contact_list->contact_count = parent::getValue($props, "contact_count");
$contact_list->created_date = parent::getValue($props, "created_date");
$contact_list->modified_date = parent::getValue($props, "modified_date");
return $contact_list;
}
public function toJson() {
return json_encode($this);
}
}