1 | <?php |
||
9 | class Connection |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $pubUrl; |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $subUrls; |
||
20 | |||
21 | /** |
||
22 | * @var FilterInterface[] |
||
23 | */ |
||
24 | protected $filters = array(); |
||
25 | |||
26 | /** |
||
27 | * @var IdGeneratorInterface |
||
28 | */ |
||
29 | protected $idGenerator = null; |
||
30 | |||
31 | /** |
||
32 | * @var SenderInterface |
||
33 | */ |
||
34 | protected $sender = null; |
||
35 | |||
36 | /** |
||
37 | * @param string $pubUrl |
||
38 | * @param array $subUrls |
||
39 | */ |
||
40 | public function __construct($pubUrl, $subUrls) |
||
45 | |||
46 | /** |
||
47 | * @param FilterInterface $filter |
||
48 | */ |
||
49 | public function addFilter(FilterInterface $filter) |
||
53 | |||
54 | /** |
||
55 | * @param string $data |
||
56 | * @return string |
||
57 | */ |
||
58 | public function filter($data) |
||
65 | |||
66 | /** |
||
67 | * @param string[] $tokens |
||
68 | * @return string[] |
||
69 | */ |
||
70 | public function filterTokens(array $tokens) |
||
78 | |||
79 | /** |
||
80 | * @param IdGeneratorInterface $idGenerator |
||
81 | */ |
||
82 | public function setIdGenerator(IdGeneratorInterface $idGenerator) |
||
86 | |||
87 | /** |
||
88 | * @param SenderInterface $sender |
||
89 | */ |
||
90 | public function setSender(SenderInterface $sender) |
||
94 | |||
95 | /** |
||
96 | * @param string[] $tokens |
||
97 | * @return array |
||
98 | */ |
||
99 | public function getSubUrls(array $tokens) |
||
109 | |||
110 | /** |
||
111 | * @param $token string |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getPubUrl($token) |
||
120 | |||
121 | /** |
||
122 | * @param string $token |
||
123 | * @param mixed $data |
||
124 | * @param string $type |
||
125 | * @param string $id |
||
126 | * @return bool |
||
127 | */ |
||
128 | public function send($token, $data, $type = null, $id = null) |
||
164 | } |
||
165 |