CommandEvent.php 1.3KB

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