Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StatementExecutionSubscriber.php

function StatementExecutionSubscriber::onStatementExecutionEnd

Subscribes to a statement execution finished event.

Logs the statement query if logging is active.

Parameters

\Drupal\Core\Database\Event\StatementExecutionEndEvent $event: The database event.

File

core/lib/Drupal/Core/Database/EventSubscriber/StatementExecutionSubscriber.php, line 31

Class

StatementExecutionSubscriber
Response subscriber to statement executions.

Namespace

Drupal\Core\Database\EventSubscriber

Code

public function onStatementExecutionEnd(StatementExecutionEndEvent $event) : void {
    $logger = Database::getConnection($event->target, $event->key)
        ->getLogger();
    if ($logger) {
        $logger->logFromEvent($event);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal