You are here

public function PoolForm::createNew in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Form/PoolForm.php \Drupal\cms_content_sync\Form\PoolForm::createNew()
  2. 2.0.x src/Form/PoolForm.php \Drupal\cms_content_sync\Form\PoolForm::createNew()

Rebuild form for next step.

Parameters

array $form:

File

src/Form/PoolForm.php, line 114

Class

PoolForm
Form handler for the Pool add and edit forms.

Namespace

Drupal\cms_content_sync\Form

Code

public function createNew($form, FormStateInterface $form_state) {
  $form_state
    ->setValue('id', 'new');

  // If we only use ->setValue() the default value in the input element will still be whatever was selected at the radios.
  $data = $form_state
    ->getUserInput();
  $data['id'] = 'new';
  $form_state
    ->setUserInput($data);
  $form_state
    ->setRebuild();
}