Added a callback hook "onTranslatableCreate" that can be used to create translations of dependent objects

This commit is contained in:
Roman 2012-12-12 16:44:18 +01:00
parent 084b22a414
commit debc410a60

View File

@ -1323,6 +1323,11 @@ class Translatable extends DataExtension implements PermissionProvider {
$newTranslation->_TranslationGroupID = $translationGroupID ? $translationGroupID : $this->owner->ID;
if($saveTranslation) $newTranslation->write();
// run callback on page for translation related hooks
if($newTranslation->hasMethod('onTranslatableCreate')){
$newTranslation->onTranslatableCreate($saveTranslation);
}
return $newTranslation;
}