-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBroadcastClient.class.php
81 lines (65 loc) · 1.73 KB
/
BroadcastClient.class.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
<?php
namespace SimClient;
/**
* @file
* Broadcast client implementation for Selligent.
*/
require_once('SimProxy.class.php');
class BroadcastClient extends SimProxy {
private $xml = '';
private $campaignId = '';
private $state = '';
public function setXml($xml) {
$this->xml = $xml;
}
public function setCampaignId($campaignId) {
$this->campaignId = $campaignId;
}
public function setState($state) {
$this->state = $state;
}
/**
* Overrides abstract function getSoapUrl
*/
protected function getSoapUrl() {
return $this->broadcastURL;
}
/**
* @param xml $xml defines the campaign
*/
public function createCampaign() {
if ($this->xml == '') {
throw new \Exception('Not all properties are set for this method.');
}
$input = array();
$input['Xml'] = $this->xml;
$result = $this->call('CreateCampaign', $xml);
return $result;
}
/**
* @param int $campaignID the ID of the targeted campaign
* @param string $newState the new state of the campaign
*/
public function setCampaignState() {
if ($this->state == '' || $this->campaignId == '') {
throw new \Exception('Not all properties are set for this method.');
}
$input = array();
$input['CampaignID'] = $this->campaignID;
$input['NewState'] = $this->newState;
$result = $this->call('SetCampaignState', $input);
return $result;
}
/**
* @param xml $xml contains the userdata to process
*/
public function processUserData() {
if ($this->xml == '') {
throw new \Exception('Not all properties are set for this method.');
}
$input = array();
$input['xml'] = $this->xml;
$result = $this->call('ProcessUserData', $xml);
return $result;
}
}