ConnectionException.php 969 B

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