CommandEvent.php 1.4 KB

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. *
  12. * @author Chris Corbyn
  13. */
  14. class Swift_Events_CommandEvent extends Swift_Events_EventObject
  15. {
  16. /**
  17. * The command sent to the server.
  18. *
  19. * @var string
  20. */
  21. private $_command;
  22. /**
  23. * An array of codes which a successful response will contain.
  24. *
  25. * @var integer[]
  26. */
  27. private $_successCodes = array();
  28. /**
  29. * Create a new CommandEvent for $source with $command.
  30. *
  31. * @param Swift_Transport $source
  32. * @param string $command
  33. * @param array $successCodes
  34. */
  35. public function __construct(Swift_Transport $source, $command, $successCodes = array())
  36. {
  37. parent::__construct($source);
  38. $this->_command = $command;
  39. $this->_successCodes = $successCodes;
  40. }
  41. /**
  42. * Get the command which was sent to the server.
  43. *
  44. * @return string
  45. */
  46. public function getCommand()
  47. {
  48. return $this->_command;
  49. }
  50. /**
  51. * Get the numeric response codes which indicate success for this command.
  52. *
  53. * @return integer[]
  54. */
  55. public function getSuccessCodes()
  56. {
  57. return $this->_successCodes;
  58. }
  59. }