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 response is received on a SMTP connection. 13 * 14 * @author Chris Corbyn 15 */ 16class Swift_Events_ResponseEvent extends Swift_Events_EventObject 17{ 18 /** 19 * The overall result. 20 * 21 * @var bool 22 */ 23 private $_valid; 24 25 /** 26 * The response received from the server. 27 * 28 * @var string 29 */ 30 private $_response; 31 32 /** 33 * Create a new ResponseEvent for $source and $response. 34 * 35 * @param Swift_Transport $source 36 * @param string $response 37 * @param bool $valid 38 */ 39 public function __construct(Swift_Transport $source, $response, $valid = false) 40 { 41 parent::__construct($source); 42 $this->_response = $response; 43 $this->_valid = $valid; 44 } 45 46 /** 47 * Get the response which was received from the server. 48 * 49 * @return string 50 */ 51 public function getResponse() 52 { 53 return $this->_response; 54 } 55 56 /** 57 * Get the success status of this Event. 58 * 59 * @return bool 60 */ 61 public function isValid() 62 { 63 return $this->_valid; 64 } 65} 66