function Connection::enableEvents

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::enableEvents()

Enables database API events dispatching.

Parameters

string[] $eventNames: A list of database events to be enabled.

Return value

static

File

core/lib/Drupal/Core/Database/Connection.php, line 2110

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

public function enableEvents(array $eventNames) : static {
    foreach ($eventNames as $eventName) {
        assert(class_exists($eventName), "Event class {$eventName} does not exist");
        $this->enabledEvents[$eventName] = TRUE;
    }
    return $this;
}

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