function tmgmt_extension_suit_tmgmt_job_presave in TMGMT Extension Suite 8
Same name and namespace in other branches
- 8.3 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().
Parameters
\Drupal\Core\Entity\EntityInterface $entity:
File
- ./
tmgmt_extension_suit.module, line 407
Code
function tmgmt_extension_suit_tmgmt_job_presave(Drupal\Core\Entity\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);
}
}