1: <?php
2:
3: /**
4: * Avisota newsletter and mailing system
5: *
6: * PHP Version 5.3
7: *
8: * @copyright bit3 UG 2013
9: * @author Tristan Lins <tristan.lins@bit3.de>
10: * @package avisota-core
11: * @license LGPL-3.0+
12: * @link http://avisota.org
13: */
14:
15: namespace Avisota\Event;
16:
17: use Avisota\Message\MessageInterface;
18: use Avisota\Queue\EventEmittingQueueInterface;
19: use Avisota\Queue\QueueInterface;
20: use Symfony\Component\EventDispatcher\Event;
21:
22: /**
23: * Abstract event triggered by an
24: * {@link http://avisota.github.io/core/class-Avisota.Queue.EventEmittingQueueInterface.html
25: * event emitting queue}.
26: *
27: * @package avisota-core
28: */
29: class PostEnqueueEvent extends Event
30: {
31: const NAME = 'avisota.queue.post-enqueue';
32:
33: /**
34: * The message to be transported.
35: *
36: * @var MessageInterface
37: */
38: protected $message;
39:
40: /**
41: * The queue that send the message.
42: *
43: * @var QueueInterface
44: */
45: protected $queue;
46:
47: public function __construct(MessageInterface $message, QueueInterface $queue)
48: {
49: $this->message = $message;
50: $this->queue = $queue;
51: }
52:
53: /**
54: * Get the message to be transported.
55: *
56: * @return \Avisota\Message\MessageInterface
57: */
58: public function getMessage()
59: {
60: return $this->message;
61: }
62:
63: /**
64: * Get the transporting queue.
65: *
66: * @return QueueInterface
67: */
68: public function getQueue()
69: {
70: return $this->queue;
71: }
72: }