protected static function injectValue(TemplateInterface $template, TemplateTranslationInterface $translation, $field): void
    {
        $setter = 'set'.ucfirst($field);
        $getter = 'get'.ucfirst($field);
        $refTpl = new \ReflectionClass($template);
        $refTrans = new \ReflectionClass($translation);

        if ($refTrans->hasMethod($getter) && $refTpl->hasMethod($setter)) {
            $val = $translation->{$getter}();

            if (null !== $val) {
                $template->{$setter}($val);
            }
        }
    }
protected static function injectValue(TemplateInterface $template, TemplateTranslationInterface $translation, $field): void
    {
        $setter = 'set'.ucfirst($field);
        $getter = 'get'.ucfirst($field);
        $refTpl = new \ReflectionClass($template);
        $refTrans = new \ReflectionClass($translation);

        if ($refTrans->hasMethod($getter) && $refTpl->hasMethod($setter)) {
            $val = $translation->{$getter}();

            if (null !== $val) {
                $template->{$setter}($val);
            }
        }
    }
protected static function injectValue ( TemplateInterface $ template , TemplateTranslationInterface $ translation , $ field ) : void { $ setter = 'set' . ucfirst ( $ field ) ; $ getter = 'get' . ucfirst ( $ field ) ; $ refTpl = new \ ReflectionClass ( $ template ) ; $ refTrans = new \ ReflectionClass ( $ translation ) ; if ( $ refTrans -> hasMethod ( $ getter ) && $ refTpl -> hasMethod ( $ setter ) ) { $ val = $ translation -> { $ getter } ( ) ; if ( null !== $ val ) { $ template -> { $ setter } ( $ val ) ; } } }
Inject the translation value in template.

@param TemplateInterface            $template    The template instance
@param TemplateTranslationInterface $translation The template translation instance
@param string                       $field       The field

@throws
Inject the translation value in template .