1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Copyright 2014 Underground Elephant |
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
|
|
|
* @package qpush-bundle |
19
|
|
|
* @copyright Underground Elephant 2014 |
20
|
|
|
* @license Apache License, Version 2.0 |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
namespace Uecode\Bundle\QPushBundle\Event; |
24
|
|
|
|
25
|
|
|
use Symfony\Component\EventDispatcher\Event; |
26
|
|
|
use Uecode\Bundle\QpushBundle\Message\Message; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @author Keith Kirk <[email protected]> |
30
|
|
|
*/ |
31
|
|
|
class MessageEvent extends Event |
32
|
|
|
{ |
33
|
|
|
/** |
34
|
|
|
* Queue name |
35
|
|
|
* |
36
|
|
|
* @var string |
37
|
|
|
*/ |
38
|
|
|
protected $queueName; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Message |
42
|
|
|
* |
43
|
|
|
* @var mixed |
44
|
|
|
*/ |
45
|
|
|
protected $message; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Constructor. |
49
|
|
|
* |
50
|
|
|
* @param string $queueName The queue name |
51
|
|
|
* @param Message $message The Message |
52
|
|
|
*/ |
53
|
10 |
|
public function __construct($queueName, Message $message) |
54
|
|
|
{ |
55
|
10 |
|
$this->queueName = $queueName; |
56
|
10 |
|
$this->message = $message; |
57
|
10 |
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Return the SQS Queue Name |
61
|
|
|
* |
62
|
|
|
* @return string |
63
|
|
|
*/ |
64
|
1 |
|
public function getQueueName() |
65
|
|
|
{ |
66
|
1 |
|
return $this->queueName; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* Return the Full SQS Message |
71
|
|
|
* |
72
|
|
|
* @return Message |
73
|
|
|
*/ |
74
|
4 |
|
public function getMessage() |
75
|
|
|
{ |
76
|
4 |
|
return $this->message; |
77
|
|
|
} |
78
|
|
|
} |
79
|
|
|
|