public static function Database::ignoreTarget

public static Database::ignoreTarget($key, $target)

Instructs the system to temporarily ignore a given key/target.

At times we need to temporarily disable replica queries. To do so, call this method with the database key and the target to disable. That database key will then always fall back to 'default' for that key, even if it's defined.

Parameters

string $key: The database connection key.

string $target: The target of the specified key to ignore.

File

core/lib/Drupal/Core/Database/Database.php, line 438

Class

Database
Primary front-controller for the database system.

Namespace

Drupal\Core\Database

Code

public static function ignoreTarget($key, $target) {
  self::$ignoreTargets[$key][$target] = TRUE;
}

© 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/core!lib!Drupal!Core!Database!Database.php/function/Database::ignoreTarget/8.1.x