1 | <?php |
||
48 | class ConnectionStateChangeEvent extends Event |
||
49 | { |
||
50 | const EVENT_NAME = 'connectionStateChange'; |
||
51 | |||
52 | /** |
||
53 | * Constructor |
||
54 | * |
||
55 | * @param Connection $connection The DB connection |
||
56 | * @param integer $previousState Previous state of the connection |
||
57 | * @param integer $newState New state |
||
58 | * |
||
59 | * @return void |
||
|
|||
60 | */ |
||
61 | public function __construct(Connection $connection, $previousState, $newState) |
||
71 | |||
72 | /** |
||
73 | * Returns the Connection instance |
||
74 | * |
||
75 | * @return Connection |
||
76 | */ |
||
77 | public function getConnection() |
||
81 | |||
82 | /** |
||
83 | * Returns the previous state of the connection |
||
84 | * |
||
85 | * @return integer |
||
86 | */ |
||
87 | public function getPreviousState() |
||
91 | |||
92 | /** |
||
93 | * Returns the new state of the connection |
||
94 | * |
||
95 | * @return integer |
||
96 | */ |
||
97 | public function getNewState() |
||
101 | } |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.