function lingotek_form_content_entity_form_submit in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 lingotek.module \lingotek_form_content_entity_form_submit()
- 4.0.x lingotek.module \lingotek_form_content_entity_form_submit()
- 3.0.x lingotek.module \lingotek_form_content_entity_form_submit()
- 3.1.x lingotek.module \lingotek_form_content_entity_form_submit()
- 3.2.x lingotek.module \lingotek_form_content_entity_form_submit()
- 3.3.x lingotek.module \lingotek_form_content_entity_form_submit()
- 3.4.x lingotek.module \lingotek_form_content_entity_form_submit()
- 3.5.x lingotek.module \lingotek_form_content_entity_form_submit()
- 3.6.x lingotek.module \lingotek_form_content_entity_form_submit()
- 3.7.x lingotek.module \lingotek_form_content_entity_form_submit()
- 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 355 - lingotek.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 ContentEntityFormInterface $entity_form */
$entity_form = $form_state
->getFormObject();
/** @var ContentEntityInterface $entity */
$entity = $entity_form
->getEntity();
if ($entity_form
->getOperation() !== 'lingotek_metadata') {
$profile_id = $form_values['lingotek_translation_profile'];
$lingotek_config
->setProfile($entity, $profile_id, FALSE);
}
}