|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* Copyright 2014 Brian Smith <[email protected]>. |
|
5
|
|
|
* |
|
6
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
7
|
|
|
* you may not use this file except in compliance with the License. |
|
8
|
|
|
* You may obtain a copy of the License at |
|
9
|
|
|
* |
|
10
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
11
|
|
|
* |
|
12
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
13
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
14
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15
|
|
|
* See the License for the specific language governing permissions and |
|
16
|
|
|
* limitations under the License. |
|
17
|
|
|
*/ |
|
18
|
|
|
|
|
19
|
|
|
namespace phparia\Events; |
|
20
|
|
|
|
|
21
|
|
|
use phparia\Client\AriClient; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* User-generated event with additional user-defined fields in the object. |
|
25
|
|
|
* |
|
26
|
|
|
* @author Brian Smith <[email protected]> |
|
27
|
|
|
*/ |
|
28
|
|
|
class ChannelUserevent extends Event |
|
29
|
|
|
{ |
|
30
|
|
|
/** |
|
31
|
|
|
* @var Bridge (optional) - A bridge that is signaled with the user event. |
|
32
|
|
|
*/ |
|
33
|
|
|
private $bridge; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @var Channel (optional) - A channel that is signaled with the user event. |
|
37
|
|
|
*/ |
|
38
|
|
|
private $channel; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @var Endpoint (optional) - A endpoint that is signaled with the user event. |
|
42
|
|
|
*/ |
|
43
|
|
|
private $endpoint; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* @var string The name of the user event. |
|
47
|
|
|
*/ |
|
48
|
|
|
private $eventname; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @var object Custom Userevent data |
|
52
|
|
|
*/ |
|
53
|
|
|
private $userevent; |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @return Bridge (optional) - A bridge that is signaled with the user event. |
|
57
|
|
|
*/ |
|
58
|
|
|
public function getBridge() |
|
59
|
|
|
{ |
|
60
|
|
|
return $this->bridge; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @return Channel (optional) - A channel that is signaled with the user event. |
|
65
|
|
|
*/ |
|
66
|
|
|
public function getChannel() |
|
67
|
|
|
{ |
|
68
|
|
|
return $this->channel; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @return Endpoint (optional) - A endpoint that is signaled with the user event. |
|
73
|
|
|
*/ |
|
74
|
|
|
public function getEndpoint() |
|
75
|
|
|
{ |
|
76
|
|
|
return $this->endpoint; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* @return string The name of the user event. |
|
81
|
|
|
*/ |
|
82
|
|
|
public function getEventname() |
|
83
|
|
|
{ |
|
84
|
|
|
return $this->eventname; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* @return mixed Custom Userevent data |
|
89
|
|
|
*/ |
|
90
|
|
|
public function getUserevent() |
|
91
|
|
|
{ |
|
92
|
|
|
return $this->userevent; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* @param AriClient $client |
|
97
|
|
|
* @param string $response |
|
98
|
|
|
*/ |
|
99
|
|
|
public function __construct(AriClient $client, $response) |
|
100
|
|
|
{ |
|
101
|
|
|
parent::__construct($client, $response); |
|
102
|
|
|
|
|
103
|
|
|
$this->bridge = $this->getResponseValue('bridge', '\phparia\Resources\Bridge', $client); |
|
104
|
|
|
$this->channel = $this->getResponseValue('channel', '\phparia\Resources\Channel', $client); |
|
105
|
|
|
$this->endpoint = $this->getResponseValue('endpoint', '\phparia\Resources\Endpoint', $client); |
|
106
|
|
|
$this->eventname = $this->getResponseValue('eventname'); |
|
107
|
|
|
$this->userevent = $this->getResponseValue('userevent'); |
|
108
|
|
|
} |
|
109
|
|
|
} |
|
110
|
|
|
|