1 | <?php |
||
13 | class DatabaseException extends Exception { |
||
14 | |||
15 | /** |
||
16 | * The SQL that generated this error |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $sql = null; |
||
21 | |||
22 | /** |
||
23 | * The parameters given for this query, if any |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $parameters = array(); |
||
28 | |||
29 | /** |
||
30 | * Returns the SQL that generated this error |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | public function getSQL() { |
||
37 | |||
38 | /** |
||
39 | * The parameters given for this query, if any |
||
40 | * |
||
41 | * @return array |
||
42 | */ |
||
43 | public function getParameters() { |
||
46 | |||
47 | /** |
||
48 | * Constructs the database exception |
||
49 | * |
||
50 | * @param string $message The Exception message to throw. |
||
51 | * @param integer $code The Exception code. |
||
52 | * @param Exception $previous The previous exception used for the exception chaining. |
||
53 | * @param string $sql The SQL executed for this query |
||
54 | * @param array $parameters The parameters given for this query, if any |
||
55 | */ |
||
56 | function __construct($message = '', $code = 0, $previous = null, $sql = null, $parameters = array()) { |
||
61 | } |
||
62 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.