function tmgmt_extension_suit_tmgmt_job_presave in TMGMT Extension Suite 8.3
Same name and namespace in other branches
- 8 tmgmt_extension_suit.module \tmgmt_extension_suit_tmgmt_job_presave()
- 8.2 tmgmt_extension_suit.module \tmgmt_extension_suit_tmgmt_job_presave()
Implements hook_ENTITY_TYPE_update().
File
- ./
tmgmt_extension_suit.module, line 254 - Main module file for the TMGMT Smartling module.
Code
function tmgmt_extension_suit_tmgmt_job_presave(EntityInterface $entity) {
try {
if ($entity
->hasTranslator()) {
$plugin = $entity
->getTranslatorPlugin();
if ($plugin instanceof ExtendedTranslatorPluginInterface) {
$entity
->set('job_file_name', $plugin
->getFileName($entity));
}
}
} catch (TMGMTException $e) {
watchdog_exception('tmgmt_smartling', $e);
}
}