src/Translation/Service/TranslationService.php
public function transfer(Translatable $model)
    {
        $properties = $this->getProperties($model);

        foreach ($properties as $property) {
            $get = 'get'.$property->getName();
            $set = 'set'.$property->getName();
            $values = $model->$get();

            if (null !== $values) {
                foreach ($values as $locale => $value) {
                    $model->translate($locale, false)->$set($value);
                }
            }
        }

        $model->mergeNewTranslations();
    }
public function transfer(Translatable $model)
    {
        $properties = $this->getProperties($model);

        foreach ($properties as $property) {
            $get = 'get'.$property->getName();
            $set = 'set'.$property->getName();
            $values = $model->$get();

            if (null !== $values) {
                foreach ($values as $locale => $value) {
                    $model->translate($locale, false)->$set($value);
                }
            }
        }

        $model->mergeNewTranslations();
    }
public function transfer ( Translatable $ model ) { $ properties = $ this -> getProperties ( $ model ) ; foreach ( $ properties as $ property ) { $ get = 'get' . $ property -> getName ( ) ; $ set = 'set' . $ property -> getName ( ) ; $ values = $ model -> $ get ( ) ; if ( null !== $ values ) { foreach ( $ values as $ locale => $ value ) { $ model -> translate ( $ locale , false ) -> $ set ( $ value ) ; } } } $ model -> mergeNewTranslations ( ) ; }
Transfer translatable properties to translations

@param \Ds\Component\Translation\Model\Type\Translatable $model
Transfer translatable properties to translations