Documentation

No matching pages.

API

Config

Facade

Lifecycle

Class: DatabaseOperationFailed

Full name: Azera\Db\Event\DatabaseOperationFailed

Dispatched when a PDO exception is caught and being processed by Database::processPdoException().

Listeners can use this for error logging, alerting, or metrics. The exception may be re-thrown after processing; this event fires before that decision is made.

The $operation identifies which Database operation failed (e.g. query, prepare, execute, beginTransaction, commit, rollback). The $sql and $params are only populated when the failing operation had a SQL statement in scope.

Public Properties

  • public readonly PDOException $exception ·
  • public readonly string $operation ·
  • public readonly string|null $sql ·
  • public readonly array|null $params ·
  • public readonly Database $database ·

Public methods

__construct() ·

public function __construct(Azera\Db\Database $database, PDOException $exception, string $operation, string|null $sql = null, array|null $params = null): mixed

Parameters

Name Type Default Description
$database Database -
$exception PDOException -
$operation string -
$sql string|null null
$params array|null null

Return value

  • Type: mixed

Back to the Index