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 Symfony\Component\EventDispatcher\Event;
20:
21: /**
22: * Abstract event triggered by an
23: * {@link http://avisota.github.io/core/class-Avisota.Queue.EventEmittingQueueInterface.html
24: * event emitting queue}.
25: *
26: * @package avisota-core
27: */
28: abstract class AbstractTransportMessageEvent extends Event
29: {
30: /**
31: * The message to be transported.
32: *
33: * @var MessageInterface
34: */
35: protected $message;
36:
37: /**
38: * The queue that send the message.
39: *
40: * @var EventEmittingQueueInterface
41: */
42: protected $queue;
43:
44: public function __construct(MessageInterface $message, EventEmittingQueueInterface $queue)
45: {
46: $this->message = $message;
47: $this->queue = $queue;
48: }
49:
50: /**
51: * Get the message to be transported.
52: *
53: * @return \Avisota\Message\MessageInterface
54: */
55: public function getMessage()
56: {
57: return $this->message;
58: }
59:
60: /**
61: * Get the transporting queue.
62: *
63: * @return \Avisota\Queue\EventEmittingQueueInterface
64: */
65: public function getQueue()
66: {
67: return $this->queue;
68: }
69: }