UniqueConstraintViolationException
class UniqueConstraintViolationException extends QueryException (View source)
Properties
| string | $connectionName | The database connection name. |
from QueryException |
| protected string | $sql | The SQL for the query. |
from QueryException |
| protected array | $bindings | The bindings for the query. |
from QueryException |
| $readWriteType | The PDO read / write type for the executed query. |
from QueryException | |
| protected array | $connectionDetails | The connection details for the query (host, port, database, etc.). |
from QueryException |
Methods
Create a new query exception instance.
Format the SQL error message.
Format the connection details for the error message.
Get the raw SQL representation of the query with embedded bindings.
Get information about the connection such as host, port, database, etc.
Details
__construct(string $connectionName, string $sql, array $bindings, Throwable $previous, array $connectionDetails = [], $readWriteType = null)
Create a new query exception instance.
protected string
formatMessage(string $connectionName, string $sql, array $bindings, Throwable $previous)
Format the SQL error message.
protected string
formatConnectionDetails()
Format the connection details for the error message.
string
getConnectionName()
Get the connection name for the query.
string
getSql()
Get the SQL for the query.
string
getRawSql()
Get the raw SQL representation of the query with embedded bindings.
array
getBindings()
Get the bindings for the query.
array
getConnectionDetails()
Get information about the connection such as host, port, database, etc.