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\Transport;
16:
17: use Avisota\Message\MessageInterface;
18:
19: /**
20: * The transport status information.
21: *
22: * @package avisota-core
23: */
24: class TransportStatus
25: {
26: /**
27: * @var MessageInterface
28: */
29: protected $message;
30:
31: /**
32: * @var int
33: */
34: protected $successfullySend;
35:
36: /**
37: * @var array
38: */
39: protected $failedRecipients;
40:
41: /**
42: * @var \Exception
43: */
44: protected $exception;
45:
46: public function __construct(
47: MessageInterface $message,
48: $successfullySend,
49: array $failedRecipients = array(),
50: \Exception $exception = null
51: ) {
52: $this->message = $message;
53: $this->successfullySend = (int) $successfullySend;
54: $this->failedRecipients = (array) $failedRecipients;
55: $this->exception = $exception;
56: }
57:
58: /**
59: * @return \Avisota\Message\MessageInterface
60: */
61: public function getMessage()
62: {
63: return $this->message;
64: }
65:
66: /**
67: * @return int
68: */
69: public function getSuccessfullySend()
70: {
71: return $this->successfullySend;
72: }
73:
74: /**
75: * @return array
76: */
77: public function getFailedRecipients()
78: {
79: return $this->failedRecipients;
80: }
81:
82: /**
83: * @return \Exception
84: */
85: public function getException()
86: {
87: return $this->exception;
88: }
89: }
90: