function Log::__construct

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Database/Log.php \Drupal\Core\Database\Log::__construct()
  2. 10 core/lib/Drupal/Core/Database/Log.php \Drupal\Core\Database\Log::__construct()
  3. 9 core/lib/Drupal/Core/Database/Log.php \Drupal\Core\Database\Log::__construct()
  4. 8.9.x core/lib/Drupal/Core/Database/Log.php \Drupal\Core\Database\Log::__construct()

Constructor.

Parameters

string $key: The database connection key for which to enable logging.

File

core/lib/Drupal/Core/Database/Log.php, line 61

Class

Log
Database query logger.

Namespace

Drupal\Core\Database

Code

public function __construct($key = 'default') {
  if (!is_string($key)) {
    @trigger_error('Passing a non-string value to the $key parameter in ' . __METHOD__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Pass only string values instead. See https://www.drupal.org/node/3577925', E_USER_DEPRECATED);
  }
  $this->connectionKey = $key;
}

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