-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstitutents.php
executable file
·82 lines (51 loc) · 1.39 KB
/
constitutents.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
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
78
79
80
81
82
<?php
require_once 'bsd_api.class.php';
require_once 'factory/array_factory.php';
class Constituent
{
private $client = null;
public function __construct($api_id, $api_secret)
{
$this->client = new BSD_API($api_id, $api_secret);
}
public function email_register($email, $constituent_id = null, $is_subscribed = false, $guid = null, $format = 'json')
{
$options = ArrayFactory::create();
$options->add('email', $email);
if (!is_null($format))
{
$format = ($format === 'json') ? $format : 'xml';
$options->add('format', $format);
}
$opts = $options->get();
return $this->client->call_api('cons/email_register', $opts);
}
public function email_unsubscribe($email, $reason)
{
}
public function list_constituent_groups()
{
$results = $this->client->call_api('cons_group/list_constituent_groups');
}
public function get_constituents_by_id($constituent_id = array(), $bundles = null, $filter = null)
{
//TODO
}
public function get_constituents($filter, $bundles)
{
//TODO
}
public function get_constituents_by_guid($guids, $bundles = null, $filter = null)
{
//TODO
}
public function get_updated_constituents($change_since, $bundles = null, $filter = null)
{
//TODO
}
public function delete_constituents_by_id($constituent_id)
{
//TODO
}
}
?>