/framework/vendor/swift/lib/classes/Swift/Events/CommandEvent.php

http://zoop.googlecode.com/ · PHP · 67 lines · 21 code · 9 blank · 37 comment · 0 complexity · bb06d21ade45b21578bb4f0eb984b6cd MD5 · raw file

  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. //@require 'Swift/Events/EventObject.php';
  10. //@require 'Swift/Transport.php';
  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. * An array of codes which a successful response will contain.
  26. * @var int[]
  27. */
  28. private $_successCodes = array();
  29. /**
  30. * Create a new CommandEvent for $source with $command.
  31. * @param Swift_Transport $source
  32. * @param string $command
  33. * @param array $successCodes
  34. */
  35. public function __construct(Swift_Transport $source,
  36. $command, $successCodes = array())
  37. {
  38. parent::__construct($source);
  39. $this->_command = $command;
  40. $this->_successCodes = $successCodes;
  41. }
  42. /**
  43. * Get the command which was sent to the server.
  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. * @return int[]
  53. */
  54. public function getSuccessCodes()
  55. {
  56. return $this->_successCodes;
  57. }
  58. }