You are here

public function RuleStatusController::disable in CRM Core 8.3

Same name and namespace in other branches
  1. 8 modules/crm_core_user_sync/src/Controller/RuleStatusController.php \Drupal\crm_core_user_sync\Controller\RuleStatusController::disable()

Disable rule.

1 string reference to 'RuleStatusController::disable'
crm_core_user_sync.routing.yml in modules/crm_core_user_sync/crm_core_user_sync.routing.yml
modules/crm_core_user_sync/crm_core_user_sync.routing.yml

File

modules/crm_core_user_sync/src/Controller/RuleStatusController.php, line 60

Class

RuleStatusController
Returns responses for CRM Core User Synchronization routes.

Namespace

Drupal\crm_core_user_sync\Controller

Code

public function disable() {
  $rule_key = $this->request
    ->get('rule_key');
  $rules = $this->configFactory
    ->getEditable('crm_core_user_sync.settings')
    ->get('rules');
  $rules[$rule_key]['enabled'] = FALSE;
  $this->configFactory
    ->getEditable('crm_core_user_sync.settings')
    ->set('rules', $rules)
    ->save();
  return $this
    ->redirect('crm_core_user_sync.config');
}