You are here

public function BusinessRuleController::disable in Business Rules 8

Same name and namespace in other branches
  1. 2.x src/Controller/BusinessRuleController.php \Drupal\business_rules\Controller\BusinessRuleController::disable()

Disables a BusinessRule object.

Parameters

\Drupal\business_rules\Entity\BusinessRule $business_rule: The BusinessRule object to disable.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse A redirect response to the config_test listing page.

1 string reference to 'BusinessRuleController::disable'
business_rules.routing.yml in ./business_rules.routing.yml
business_rules.routing.yml

File

src/Controller/BusinessRuleController.php, line 23

Class

BusinessRuleController
Class BusinessRuleController.

Namespace

Drupal\business_rules\Controller

Code

public function disable(BusinessRule $business_rule) {
  $business_rule
    ->disable()
    ->save();
  return new RedirectResponse($business_rule
    ->url('collection', [
    'absolute' => TRUE,
  ]));
}