You are here

function _entity_share_async_form_submit in Entity Share 8.3

Same name and namespace in other branches
  1. 8.2 modules/entity_share_async/entity_share_async.module \_entity_share_async_form_submit()

Submit handler for asynchronous import.

Parameters

array $form: The form.

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

1 string reference to '_entity_share_async_form_submit'
entity_share_async_form_entity_share_client_pull_form_alter in modules/entity_share_async/entity_share_async.module
Implements hook_form_FORM_ID_alter().

File

modules/entity_share_async/entity_share_async.module, line 74

Code

function _entity_share_async_form_submit(array &$form, FormStateInterface $form_state) {
  $selected_entities = $form_state
    ->getValue('entities');
  $selected_entities = array_filter($selected_entities);
  $remote_id = $form_state
    ->getValue('remote');
  $channel_id = $form_state
    ->getValue('channel');
  $import_config_id = $form_state
    ->getValue('import_config');

  /** @var \Drupal\entity_share_async\Service\QueueHelperInterface $queue_helper */
  $queue_helper = \Drupal::service('entity_share_async.queue_helper');
  $queue_helper
    ->enqueue($remote_id, $channel_id, $import_config_id, $selected_entities);
}