<?php namespace Doctrine\DBAL\Driver\PgSQL; use Doctrine\DBAL\Driver\AbstractException; use PgSql\Result as PgSqlResult; use function pg_result_error_field; use const PGSQL_DIAG_MESSAGE_PRIMARY; use const PGSQL_DIAG_SQLSTATE; /** * @internal * * @psalm-immutable */ final class Exception extends AbstractException { /** @param PgSqlResult|resource $result */ public static function fromResult($result): self { $sqlstate = pg_result_error_field($result, PGSQL_DIAG_SQLSTATE); if ($sqlstate === false) { $sqlstate = null; } return new self((string) pg_result_error_field($result, PGSQL_DIAG_MESSAGE_PRIMARY), $sqlstate); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Exception | Folder | 0755 |
|
|
Connection.php | File | 4.2 KB | 0644 |
|
ConvertParameters.php | File | 1.14 KB | 0644 |
|
Driver.php | File | 2.47 KB | 0644 |
|
Exception.php | File | 693 B | 0644 |
|
Result.php | File | 6.68 KB | 0644 |
|
Statement.php | File | 5.44 KB | 0644 |
|