You are here

protected function PullForm::setFormRedirect in Entity Share 8.3

Helper function to redirect the form.

By default it provides some parameters coming from the form state:

  • Remote
  • Channel
  • Import config
  • Search keyword.

Parameters

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

array $additional_query_parameters: Array of additional query parameters, if needed.

3 calls to PullForm::setFormRedirect()
PullForm::pagerRedirect in modules/entity_share_client/src/Form/PullForm.php
Helper function to redirect with the form to right page to handle pager.
PullForm::resetSort in modules/entity_share_client/src/Form/PullForm.php
Form submission handler to reset the sort.
PullForm::submitForm in modules/entity_share_client/src/Form/PullForm.php
Form submission handler.

File

modules/entity_share_client/src/Form/PullForm.php, line 839

Class

PullForm
Form controller to pull entities.

Namespace

Drupal\entity_share_client\Form

Code

protected function setFormRedirect(FormStateInterface $form_state, array $additional_query_parameters = []) {
  $query_parameters = [
    'remote' => $form_state
      ->getValue('remote'),
    'channel' => $form_state
      ->getValue('channel'),
    'import_config' => $form_state
      ->getValue('import_config'),
    'search' => $form_state
      ->getValue('search', ''),
  ];
  if ($additional_query_parameters) {
    $query_parameters = array_merge($query_parameters, $additional_query_parameters);
  }
  $form_state
    ->setRedirect('entity_share_client.admin_content_pull_form', [], [
    'query' => $query_parameters,
  ]);
}