You are here

function ContentTranslationHandler::entityFormDelete in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::entityFormDelete()

Form submission handler for ContentTranslationHandler::entityFormAlter().

Takes care of entity deletion.

File

core/modules/content_translation/src/ContentTranslationHandler.php, line 669
Contains \Drupal\content_translation\ContentTranslationHandler.

Class

ContentTranslationHandler
Base class for content translation handlers.

Namespace

Drupal\content_translation

Code

function entityFormDelete($form, FormStateInterface $form_state) {
  $form_object = $form_state
    ->getFormObject()
    ->getEntity();
  $entity = $form_object
    ->getEntity();
  if (count($entity
    ->getTranslationLanguages()) > 1) {
    drupal_set_message(t('This will delete all the translations of %label.', array(
      '%label' => $entity
        ->label(),
    )), 'warning');
  }
}