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

Breadcrumb

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

function Connection::setTarget

Tells this connection object what its target value is.

This is needed for logging and auditing. It's sloppy to do in the constructor because the constructor for child classes has a different signature. We therefore also ensure that this function is only ever called once.

Parameters

string $target: (optional) The target this connection is for.

File

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

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

public function setTarget($target = NULL) {
    if (!isset($this->target)) {
        $this->target = $target;
    }
}

API Navigation

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