This repository has been archived by the owner on May 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotificationCenter.php
92 lines (80 loc) · 2.16 KB
/
NotificationCenter.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
83
84
85
86
87
88
89
90
91
92
<?php
namespace Gos\Bundle\NotificationBundle;
use Gos\Bundle\NotificationBundle\Context\NotificationContextInterface;
use Gos\Bundle\NotificationBundle\Fetcher\FetcherInterface;
use Gos\Bundle\NotificationBundle\Model\NotificationInterface;
use Gos\Bundle\NotificationBundle\Publisher\PublisherInterface;
/**
* @author Johann Saunier <johann_27@hotmail.fr>
*/
class NotificationCenter implements NotificationManipulatorInterface
{
/**
* @var PublisherInterface
*/
protected $publisher;
/**
* @var FetcherInterface
*/
protected $fetcher;
/**
* @param PublisherInterface $publisher
* @param FetcherInterface $fetcher
*/
public function __construct(
PublisherInterface $publisher,
FetcherInterface $fetcher
) {
$this->publisher = $publisher;
$this->fetcher = $fetcher;
}
/**
* {@inheritdoc}
*/
public function fetch($channel, $start, $end)
{
return $this->fetcher->fetch($channel, $start, $end);
}
/**
* {@inheritdoc}
*/
public function publish($channel, NotificationInterface $notification, NotificationContextInterface $context = null)
{
return $this->publisher->publish($channel, $notification, $context);
}
/**
* {@inheritdoc}
*/
public function count($channel, array $options = [])
{
return $this->fetcher->count($channel, $options);
}
/**
* {@inheritdoc}
*/
public function getNotification($channel, $uuid)
{
return $this->fetcher->getNotification($channel, $uuid);
}
/**
* {@inheritdoc}
*/
public function markAsViewed($channel, $uuidOrNotification, $force = false)
{
return $this->fetcher->markAsViewed($channel, $uuidOrNotification, $force);
}
/**
* {@inheritdoc}
*/
public function multipleFetch(array $channels, $start, $end)
{
return $this->fetcher->multipleFetch($channels, $start, $end);
}
/**
* {@inheritdoc}
*/
public function multipleCount(array $channels, array $options = [])
{
return $this->fetcher->multipleCount($channels, $options);
}
}