| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Doctrine\DBAL;
|
|
|
4 |
|
|
|
5 |
/** @psalm-immutable */
|
|
|
6 |
class ConnectionException extends Exception
|
|
|
7 |
{
|
|
|
8 |
/** @return ConnectionException */
|
|
|
9 |
public static function commitFailedRollbackOnly()
|
|
|
10 |
{
|
|
|
11 |
return new self('Transaction commit failed because the transaction has been marked for rollback only.');
|
|
|
12 |
}
|
|
|
13 |
|
|
|
14 |
/** @return ConnectionException */
|
|
|
15 |
public static function noActiveTransaction()
|
|
|
16 |
{
|
|
|
17 |
return new self('There is no active transaction.');
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
/** @return ConnectionException */
|
|
|
21 |
public static function savepointsNotSupported()
|
|
|
22 |
{
|
|
|
23 |
return new self('Savepoints are not supported by this driver.');
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
/** @return ConnectionException */
|
|
|
27 |
public static function mayNotAlterNestedTransactionWithSavepointsInTransaction()
|
|
|
28 |
{
|
|
|
29 |
return new self('May not alter the nested transaction with savepoints behavior while a transaction is open.');
|
|
|
30 |
}
|
|
|
31 |
}
|