ContentTranslationHandler::entityFormDelete

ContentTranslationHandler::entityFormDelete($form, FormStateInterface $form_state)

Form submission handler for ContentTranslationHandler::entityFormAlter().

Takes care of entity deletion.

File

core/modules/content_translation/src/ContentTranslationHandler.php, line 664

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');
  }
}
doc_Drupal
2016-10-29 08:58:14
Comments
Leave a Comment

Please login to continue.