sqlite-database-integration
/
wp-includes
/
database
/
sqlite
/
class-wp-sqlite-driver-exception.php
class-wp-sqlite-driver-exception.php in SQLite Database Integration 2.2.22, at wp-includes/database/sqlite/class-wp-sqlite-driver-exception.php
| 1 | <?php |
| 2 | |
| 3 | class WP_SQLite_Driver_Exception extends PDOException { |
| 4 | /** |
| 5 | * The SQLite driver that originated the exception. |
| 6 | * |
| 7 | * @var WP_PDO_MySQL_On_SQLite |
| 8 | */ |
| 9 | private $driver; |
| 10 | |
| 11 | /** |
| 12 | * Constructor. |
| 13 | * |
| 14 | * @param WP_PDO_MySQL_On_SQLite $driver The SQLite driver that originated the exception. |
| 15 | * @param string $message The exception message. |
| 16 | * @param int|string $code The exception code. In PDO, it can be a string with value of SQLSTATE. |
| 17 | * @param Throwable|null $previous The previous throwable used for the exception chaining. |
| 18 | */ |
| 19 | public function __construct( |
| 20 | WP_PDO_MySQL_On_SQLite $driver, |
| 21 | string $message, |
| 22 | $code = 0, |
| 23 | ?Throwable $previous = null |
| 24 | ) { |
| 25 | parent::__construct( $message, 0, $previous ); |
| 26 | $this->code = $code; |
| 27 | $this->driver = $driver; |
| 28 | } |
| 29 | |
| 30 | public function getDriver(): WP_PDO_MySQL_On_SQLite { |
| 31 | return $this->driver; |
| 32 | } |
| 33 | } |
| 34 |