You are here

public function PullForm::synchronizeSelectedEntities in Entity Share 8.3

Same name and namespace in other branches
  1. 8 modules/entity_share_client/src/Form/PullForm.php \Drupal\entity_share_client\Form\PullForm::synchronizeSelectedEntities()
  2. 8.2 modules/entity_share_client/src/Form/PullForm.php \Drupal\entity_share_client\Form\PullForm::synchronizeSelectedEntities()

Form submission handler for the 'synchronize' action.

Parameters

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

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

File

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

Class

PullForm
Form controller to pull entities.

Namespace

Drupal\entity_share_client\Form

Code

public function synchronizeSelectedEntities(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');
  $import_context = new ImportContext($remote_id, $channel_id, $import_config_id);
  $this->importService
    ->importEntities($import_context, array_values($selected_entities));
}