| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function __construct(\PDOException $e) |
||
| 25 | { |
||
| 26 | if(strstr($e->getMessage(), 'SQLSTATE[')) { |
||
| 27 | preg_match('/SQLSTATE\[(\w+)\] \[(\w+)\] (.*)/', $e->getMessage(), $matches); |
||
| 28 | if (count($matches)) { |
||
| 29 | $this->code = ($matches[1] == 'HT000' ? $matches[2] : $matches[1]); |
||
| 30 | $this->message = $matches[3]; |
||
| 31 | } else { |
||
| 32 | $this->code = $e->getCode(); |
||
| 33 | $this->message = $e->getMessage(); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 | } |
||
| 38 |