CommandEvent.php 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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, $command, $successCodes = array())
  34. {
  35. parent::__construct($source);
  36. $this->_command = $command;
  37. $this->_successCodes = $successCodes;
  38. }
  39. /**
  40. * Get the command which was sent to the server.
  41. * @return string
  42. */
  43. public function getCommand()
  44. {
  45. return $this->_command;
  46. }
  47. /**
  48. * Get the numeric response codes which indicate success for this command.
  49. * @return int[]
  50. */
  51. public function getSuccessCodes()
  52. {
  53. return $this->_successCodes;
  54. }
  55. }