You are here

public function ResetStatusEntityConfirmation::submitForm in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 src/Form/ResetStatusEntityConfirmation.php \Drupal\cms_content_sync\Form\ResetStatusEntityConfirmation::submitForm()
  2. 2.1.x src/Form/ResetStatusEntityConfirmation.php \Drupal\cms_content_sync\Form\ResetStatusEntityConfirmation::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormInterface::submitForm

File

src/Form/ResetStatusEntityConfirmation.php, line 121

Class

ResetStatusEntityConfirmation
Provides the confirmation form for the pool reset entity status action.

Namespace

Drupal\cms_content_sync\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  Pool::resetStatusEntities($this->pool
    ->id());
  $this->messenger
    ->addMessage($this
    ->t('The status entities for the Pool @pool have been reset successfully.', [
    '@pool' => $this->pool
      ->label(),
  ]));
  $form_state
    ->setRedirect('entity.cms_content_sync_pool.collection');
}