You are here

protected function LingotekManagementForm::redirectToDeleteMultipleNodesForm in Lingotek Translation 8

Redirect to delete content form.

Parameters

array $values: Array of ids to delete.

1 call to LingotekManagementForm::redirectToDeleteMultipleNodesForm()
LingotekManagementForm::submitForm in src/Form/LingotekManagementForm.php
Form submission handler.

File

src/Form/LingotekManagementForm.php, line 661
Contains \Drupal\Lingotek\Form\LingotekManagementForm.

Class

LingotekManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function redirectToDeleteMultipleNodesForm($values, FormStateInterface $form_state) {
  $entityInfo = [];
  $entities = $this->entityManager
    ->getStorage($this->entityTypeId)
    ->loadMultiple($values);
  foreach ($entities as $entity) {

    /** @var ContentEntityInterface $entity */
    $language = $entity
      ->getUntranslated()
      ->language();
    $entityInfo[$entity
      ->id()] = [
      $language
        ->getId() => $language
        ->getId(),
    ];
  }
  $this->tempStoreFactory
    ->get($this->entityTypeId . '_multiple_delete_confirm')
    ->set($this
    ->currentUser()
    ->id(), $entityInfo);
  $form_state
    ->setRedirect($this->entityTypeId . '.multiple_delete_confirm', [], [
    'query' => $this
      ->getDestinationWithQueryArray(),
  ]);
}