function StatementBase::dispatchStatementExecutionFailureEvent

Dispatches an event informing of the statement execution failure.

Parameters

\Drupal\Core\Database\Event\StatementExecutionStartEvent|null $startEvent: The start event or NULL if event dispatching is not enabled.

\Exception $e: The statement exception thrown.

2 calls to StatementBase::dispatchStatementExecutionFailureEvent()
StatementPrefetchIterator::execute in core/lib/Drupal/Core/Database/StatementPrefetchIterator.php
Executes a prepared statement.
StatementWrapperIterator::execute in core/lib/Drupal/Core/Database/StatementWrapperIterator.php
Executes a prepared statement.

File

core/lib/Drupal/Core/Database/Statement/StatementBase.php, line 154

Class

StatementBase
StatementInterface base implementation.

Namespace

Drupal\Core\Database\Statement

Code

protected function dispatchStatementExecutionFailureEvent(?StatementExecutionStartEvent $startEvent, \Exception $e) : void {
    if (isset($startEvent) && $this->connection
        ->isEventEnabled(StatementExecutionFailureEvent::class)) {
        $this->connection
            ->dispatchEvent(new StatementExecutionFailureEvent($startEvent->statementObjectId, $startEvent->key, $startEvent->target, $startEvent->queryString, $startEvent->args, $startEvent->caller, $startEvent->time, get_class($e), $e->getCode(), $e->getMessage()));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.