-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added PDOException wrapper to avoid creating dynamic property.
- Loading branch information
1 parent
7e1da9a
commit 6b52092
Showing
3 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
class PDOExceptionWithQueryString extends PDOException { | ||
|
||
public string $queryString = ""; | ||
|
||
/** | ||
* Wrapper for PDOException to avoid creating dynamic property. | ||
* | ||
* @param PDOException $e Source exception. | ||
*/ | ||
public function __construct(PDOException $e) { | ||
parent::__construct($e->getMessage(), 0, $e->getPrevious()); | ||
|
||
$this->code = $e->code; | ||
} | ||
} |