DatabaseConnection::setTarget

public function DatabaseConnection::setTarget

public DatabaseConnection::setTarget($target = NULL)

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

$target: The target this connection is for. Set to NULL (default) to disable logging entirely.

File

includes/database/database.inc, line 498
Core systems for the database layer.

Class

DatabaseConnection
Base Database API class.

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!database!database.inc/function/DatabaseConnection::setTarget/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部