You are here

public function ProtectionRule::disableProtection in User protect 8

Disables a certain protection.

Parameters

string $instance_id: The ID of a user protection plugin to disable.

Return value

\Drupal\userprotect\Entity\ProtectionRuleInterface The called protection rule entity.

Overrides ProtectionRuleInterface::disableProtection

File

src/Entity/ProtectionRule.php, line 215

Class

ProtectionRule
Defines the Protection rule entity.

Namespace

Drupal\userprotect\Entity

Code

public function disableProtection($instance_id) {
  $this
    ->setPluginConfig($instance_id, [
    'status' => FALSE,
  ]);
  return $this;
}