You are here

public function LaunchExportForm::removeSelectedEntities in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Form/LaunchExportForm.php \Drupal\content_synchronizer\Form\LaunchExportForm::removeSelectedEntities()
  2. 3.x src/Form/LaunchExportForm.php \Drupal\content_synchronizer\Form\LaunchExportForm::removeSelectedEntities()

Remove selected entities of the import.

File

src/Form/LaunchExportForm.php, line 68

Class

LaunchExportForm
Launch Export Form.

Namespace

Drupal\content_synchronizer\Form

Code

public function removeSelectedEntities(array &$form, FormStateInterface $form_state) {
  $entitiesToRemove = $form_state
    ->getUserInput()['entities_to_export'];
  $entitiesToRemove = array_intersect_key($this->export
    ->getEntitiesList(), array_flip($entitiesToRemove));
  foreach ($entitiesToRemove as $entity) {
    $this->export
      ->removeEntity($entity);
  }
}