1: <?php
2: namespace Ctct\Components\Contacts;
3:
4: use Ctct\Components\Component;
5:
6: 7: 8: 9: 10: 11: 12:
13: class ContactList extends Component
14: {
15: 16: 17: 18:
19: public $id;
20:
21: 22: 23: 24:
25: public $name;
26:
27: 28: 29: 30:
31: public $status;
32:
33: 34: 35: 36:
37: public $contact_count;
38:
39: 40: 41: 42:
43: public $created_date;
44:
45: 46: 47: 48:
49: public $modified_date;
50:
51: public function __construct($list_id = null)
52: {
53: if (!is_null($list_id)) {
54: $this->id = $list_id;
55: }
56:
57: return $this;
58: }
59:
60: 61: 62: 63: 64:
65: public static function create(array $props)
66: {
67: $contact_list = new ContactList();
68: $contact_list->id = parent::getValue($props, "id");
69: $contact_list->name = parent::getValue($props, "name");
70: $contact_list->status = parent::getValue($props, "status");
71: $contact_list->contact_count = parent::getValue($props, "contact_count");
72: $contact_list->created_date = parent::getValue($props, "created_date");
73: $contact_list->modified_date = parent::getValue($props, "modified_date");
74: return $contact_list;
75: }
76:
77: public function toJson()
78: {
79: return json_encode($this);
80: }
81: }
82: