You are here

public function RuleStatusController::enable in CRM Core 8

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

Enable rule.

1 string reference to 'RuleStatusController::enable'
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 48

Class

RuleStatusController
Returns responses for CRM Core User Synchronization routes.

Namespace

Drupal\crm_core_user_sync\Controller

Code

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