1: <?php
2:
3: /*
4: * This file is part of SwiftMailer.
5: * (c) 2004-2009 Chris Corbyn
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10:
11: /**
12: * Generated when a command is sent over an SMTP connection.
13: * @package Swift
14: * @subpackage Events
15: * @author Chris Corbyn
16: */
17: class Swift_Events_CommandEvent extends Swift_Events_EventObject
18: {
19: /**
20: * The command sent to the server.
21: * @var string
22: */
23: private $_command;
24:
25: /**
26: * An array of codes which a successful response will contain.
27: * @var int[]
28: */
29: private $_successCodes = array();
30:
31: /**
32: * Create a new CommandEvent for $source with $command.
33: * @param Swift_Transport $source
34: * @param string $command
35: * @param array $successCodes
36: */
37: public function __construct(Swift_Transport $source, $command, $successCodes = array())
38: {
39: parent::__construct($source);
40: $this->_command = $command;
41: $this->_successCodes = $successCodes;
42: }
43:
44: /**
45: * Get the command which was sent to the server.
46: * @return string
47: */
48: public function getCommand()
49: {
50: return $this->_command;
51: }
52:
53: /**
54: * Get the numeric response codes which indicate success for this command.
55: * @return int[]
56: */
57: public function getSuccessCodes()
58: {
59: return $this->_successCodes;
60: }
61: }
62: