-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
353 additions
and
219 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
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,8 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Nextras\Dbal\Drivers\Exception; | ||
|
||
|
||
class ConnectionException extends DriverException | ||
{ | ||
} |
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,8 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Nextras\Dbal\Drivers\Exception; | ||
|
||
|
||
abstract class ConstraintViolationException extends QueryException | ||
{ | ||
} |
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,40 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Nextras\Dbal\Drivers\Exception; | ||
|
||
use Exception; | ||
|
||
|
||
class DriverException extends Exception | ||
{ | ||
/** @var int */ | ||
private $errorCode; | ||
|
||
/** @var string */ | ||
private $errorSqlState; | ||
|
||
|
||
public function __construct( | ||
string $message, | ||
int $errorCode = 0, | ||
string $errorSqlState = null, | ||
Exception $previousException = null | ||
) | ||
{ | ||
parent::__construct($message, 0, $previousException); | ||
$this->errorCode = $errorCode; | ||
$this->errorSqlState = (string) $errorSqlState; | ||
} | ||
|
||
|
||
public function getErrorCode(): int | ||
{ | ||
return $this->errorCode; | ||
} | ||
|
||
|
||
public function getErrorSqlState(): string | ||
{ | ||
return $this->errorSqlState; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/Drivers/Exception/ForeignKeyConstraintViolationException.php
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,8 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Nextras\Dbal\Drivers\Exception; | ||
|
||
|
||
class ForeignKeyConstraintViolationException extends ConstraintViolationException | ||
{ | ||
} |
8 changes: 8 additions & 0 deletions
8
src/Drivers/Exception/NotNullConstraintViolationException.php
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,8 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Nextras\Dbal\Drivers\Exception; | ||
|
||
|
||
class NotNullConstraintViolationException extends ConstraintViolationException | ||
{ | ||
} |
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,31 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Nextras\Dbal\Drivers\Exception; | ||
|
||
use Exception; | ||
|
||
|
||
class QueryException extends DriverException | ||
{ | ||
/** @var string */ | ||
private $sqlQuery; | ||
|
||
|
||
public function __construct( | ||
string $message, | ||
int $errorCode = 0, | ||
string $errorSqlState = '', | ||
Exception $previousException = null, | ||
string $sqlQuery = null | ||
) | ||
{ | ||
parent::__construct($message, $errorCode, $errorSqlState, $previousException); | ||
$this->sqlQuery = (string) $sqlQuery; | ||
} | ||
|
||
|
||
public function getSqlQuery(): string | ||
{ | ||
return $this->sqlQuery; | ||
} | ||
} |
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,8 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Nextras\Dbal\Drivers\Exception; | ||
|
||
|
||
class UniqueConstraintViolationException extends ConstraintViolationException | ||
{ | ||
} |
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
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
Oops, something went wrong.