|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace IrishDan\NotificationBundle\Broadcast; |
|
4
|
|
|
|
|
5
|
|
|
use IrishDan\NotificationBundle\Notification\NotifiableInterface; |
|
6
|
|
|
use IrishDan\NotificationBundle\Slackable; |
|
7
|
|
|
|
|
8
|
|
|
|
|
9
|
|
|
class Broadcast implements BroadcastNotifiableInterface, NotifiableInterface, Slackable |
|
10
|
|
|
{ |
|
11
|
|
|
protected $slackWebhook; |
|
12
|
|
|
private $subscribedChannels = [ |
|
13
|
|
|
'broadcast', |
|
14
|
|
|
]; |
|
15
|
|
|
|
|
16
|
|
|
public function getSubscribedChannels() |
|
17
|
|
|
{ |
|
18
|
|
|
return $this->subscribedChannels; |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
public function isSubscribedToChannel($channel) |
|
22
|
|
|
{ |
|
23
|
|
|
return in_array($this->subscribedChannels, $channel); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
public function setSlackWebhook($webhook) |
|
27
|
|
|
{ |
|
28
|
|
|
$this->slackWebhook = $webhook; |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function getSlackWebhook() |
|
32
|
|
|
{ |
|
33
|
|
|
return $this->slackWebhook; |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
// @TODO: NotificationInteface Refactor out of |
|
37
|
|
|
public function getNotifiableDetailsForChannel($driver) |
|
38
|
|
|
{ |
|
39
|
|
|
// TODO: Implement getNotifiableDetailsForChannel() method. |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function getEmail() |
|
43
|
|
|
{ |
|
44
|
|
|
// TODO: Implement getEmail() method. |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public function notifications() |
|
48
|
|
|
{ |
|
49
|
|
|
// TODO: Implement notifications() method. |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function readNotifications() |
|
53
|
|
|
{ |
|
54
|
|
|
// TODO: Implement readNotifications() method. |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public function unreadNotifications() |
|
58
|
|
|
{ |
|
59
|
|
|
// TODO: Implement unreadNotifications() method. |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function notify($instance) |
|
63
|
|
|
{ |
|
64
|
|
|
// TODO: Implement notify() method. |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|