public function FlowForm::disableBundle in CMS Content Sync 2.1.x
Same name and namespace in other branches
- 8 src/Form/FlowForm.php \Drupal\cms_content_sync\Form\FlowForm::disableBundle()
- 2.0.x src/Form/FlowForm.php \Drupal\cms_content_sync\Form\FlowForm::disableBundle()
Disable bundle => hide settings.
Parameters
array $form:
File
- src/
Form/ FlowForm.php, line 359
Class
- FlowForm
- Form handler for the Flow add and edit forms.
Namespace
Drupal\cms_content_sync\FormCode
public function disableBundle($form, FormStateInterface $form_state) {
$trigger = $form_state
->getTriggeringElement();
$entity_type_name = $trigger['#entity_type'];
$bundle_name = $trigger['#bundle'];
$this->triggeringType = $entity_type_name;
$this->triggeringBundle = $bundle_name;
$this->triggeredAction = 'disable';
$this
->fixMissingFormStateFromAjax($form, $form_state);
$form_state
->setValue([
$entity_type_name,
$bundle_name,
'edit',
], '0');
$form_state
->setValue([
$entity_type_name,
$bundle_name,
'handler',
], 'ignore');
$form_state
->setRebuild();
}