You are here

public function ConfigSplitController::disableEntity in Configuration Split 2.0.x

Same name and namespace in other branches
  1. 8 src/Controller/ConfigSplitController.php \Drupal\config_split\Controller\ConfigSplitController::disableEntity()

Disable the split.

Parameters

string $config_split: The split name.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse The response.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

\Drupal\Core\Entity\EntityStorageException

1 string reference to 'ConfigSplitController::disableEntity'
config_split.routing.yml in ./config_split.routing.yml
config_split.routing.yml

File

src/Controller/ConfigSplitController.php, line 46

Class

ConfigSplitController
The controller for split actions.

Namespace

Drupal\config_split\Controller

Code

public function disableEntity($config_split) {
  $entity = $this
    ->entityTypeManager()
    ->getStorage('config_split')
    ->load($config_split);
  $entity
    ->set('status', FALSE);
  $entity
    ->save();
  return $this
    ->redirect('entity.config_split.collection');
}