You are here

function lingotek_form_content_entity_form_submit in Lingotek Translation 3.2.x

Same name and namespace in other branches
  1. 8 lingotek.module \lingotek_form_content_entity_form_submit()
  2. 8.2 lingotek.module \lingotek_form_content_entity_form_submit()
  3. 4.0.x lingotek.module \lingotek_form_content_entity_form_submit()
  4. 3.0.x lingotek.module \lingotek_form_content_entity_form_submit()
  5. 3.1.x lingotek.module \lingotek_form_content_entity_form_submit()
  6. 3.3.x lingotek.module \lingotek_form_content_entity_form_submit()
  7. 3.4.x lingotek.module \lingotek_form_content_entity_form_submit()
  8. 3.5.x lingotek.module \lingotek_form_content_entity_form_submit()
  9. 3.6.x lingotek.module \lingotek_form_content_entity_form_submit()
  10. 3.7.x lingotek.module \lingotek_form_content_entity_form_submit()
  11. 3.8.x lingotek.module \lingotek_form_content_entity_form_submit()

Parameters

array $form:

\Drupal\Core\Form\FormStateInterface $form_state:

1 string reference to 'lingotek_form_content_entity_form_submit'
lingotek_form_alter in ./lingotek.module
Implements hook_form_alter().

File

./lingotek.module, line 551
Implements Drupal-related hooks for the Lingotek Translation module.

Code

function lingotek_form_content_entity_form_submit(array $form, FormStateInterface $form_state) {
  $form_values = $form_state
    ->getValues();

  /** @var \Drupal\lingotek\LingotekContentTranslationServiceInterface $translation_service */
  $translation_service = \Drupal::service('lingotek.content_translation');

  /** @var \Drupal\lingotek\LingotekConfigurationServiceInterface $lingotek_config */
  $lingotek_config = \Drupal::service('lingotek.configuration');

  /** @var \Drupal\Core\Entity\ContentEntityFormInterface $entity_form */
  $entity_form = $form_state
    ->getFormObject();

  /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
  $entity = $entity_form
    ->getEntity();
  if ($entity_form
    ->getOperation() !== 'lingotek_metadata') {
    $profile_id = $form_values['lingotek_translation_management']['lingotek_translation_profile'];
    $lingotek_config
      ->setProfile($entity, $profile_id, FALSE);
  }
}