| 1 | <?php |
||
| 14 | class ChildishException extends \PDOException |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * The SQL for the query. |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | protected $sql; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * The bindings for the query. |
||
| 25 | * |
||
| 26 | * @var array |
||
| 27 | */ |
||
| 28 | protected $bindings; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Create a new query exception instance. |
||
| 32 | * |
||
| 33 | * @param string $sql |
||
| 34 | * @param array $bindings |
||
| 35 | * @param \Exception $previous |
||
| 36 | * @return void |
||
|
|
|||
| 37 | */ |
||
| 38 | public function __construct($sql, array $bindings, $previous) |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Format the SQL error message. |
||
| 54 | * |
||
| 55 | * @param string $sql |
||
| 56 | * @param array $bindings |
||
| 57 | * @param \Exception $previous |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | protected function formatMessage($sql, $bindings, $previous) |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Get the SQL for the query. |
||
| 67 | * |
||
| 68 | * @return string |
||
| 69 | */ |
||
| 70 | public function getSql() |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Get the bindings for the query. |
||
| 77 | * |
||
| 78 | * @return array |
||
| 79 | */ |
||
| 80 | public function getBindings() |
||
| 84 | } |
Adding a
@returnannotation 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.