1<?php
2
3/**
4 * Swift Mailer Response Event
5 * Please read the LICENSE file
6 * @copyright Chris Corbyn <chris@w3style.co.uk>
7 * @author Chris Corbyn <chris@w3style.co.uk>
8 * @package Swift_Events
9 * @license GNU Lesser General Public License
10 */
11
12/**
13 * Generated when Swift receives a server response
14 * @package Swift_Events
15 * @author Chris Corbyn <chris@w3style.co.uk>
16 */
17class Swift_Events_ResponseEvent extends Swift_Events
18{
19  /**
20   * Contains the response received
21   * @var string
22   */
23  protected $string = null;
24  /**
25   * Contains the response code
26   * @var int
27   */
28  protected $code = null;
29
30  /**
31   * Constructor
32   * @param string The received response
33   */
34  public function __construct($string)
35  {
36    $this->setString($string);
37    $this->setCode(substr($string, 0, 3));
38  }
39  /**
40   * Set the response received
41   * @param string The response
42   */
43  public function setString($string)
44  {
45    $this->string = (string) $string;
46  }
47  /**
48   * Get the received response
49   * @return string
50   */
51  public function getString()
52  {
53    return $this->string;
54  }
55  /**
56   * Set response code
57   * @param int The response code
58   */
59  public function setCode($code)
60  {
61    $this->code = (int) $code;
62  }
63  /**
64   * Get the response code
65   * @return int
66   */
67  public function getCode()
68  {
69    return $this->code;
70  }
71}
72