public function saveEntityTranslations()
    {
        if (empty($this->translationsBackup)) {
            return null;
        }

        foreach ($this->translationsBackup as $formHash => $entities) {
            foreach ($entities as $entityData) {
                $entity = $entityData['object'];
                $entityIdGetter = $entityData['idGetter'];
                $entityAlias = $entityData['alias'];
                $fields = $entityData['fields'];

                foreach ($fields as $fieldName => $locales) {
                    foreach ($locales as $locale => $translation) {
                        $this
                            ->entityTranslationProvider
                            ->setTranslation(
                                $entityAlias,
                                $entity->$entityIdGetter(),
                                $fieldName,
                                $translation,
                                $locale
                            );
                    }
                }
            }
        }

        $this
            ->entityTranslationProvider
            ->flushTranslations();
    }
public function saveEntityTranslations()
    {
        if (empty($this->translationsBackup)) {
            return null;
        }

        foreach ($this->translationsBackup as $formHash => $entities) {
            foreach ($entities as $entityData) {
                $entity = $entityData['object'];
                $entityIdGetter = $entityData['idGetter'];
                $entityAlias = $entityData['alias'];
                $fields = $entityData['fields'];

                foreach ($fields as $fieldName => $locales) {
                    foreach ($locales as $locale => $translation) {
                        $this
                            ->entityTranslationProvider
                            ->setTranslation(
                                $entityAlias,
                                $entity->$entityIdGetter(),
                                $fieldName,
                                $translation,
                                $locale
                            );
                    }
                }
            }
        }

        $this
            ->entityTranslationProvider
            ->flushTranslations();
    }
public function saveEntityTranslations ( ) { if ( empty ( $ this -> translationsBackup ) ) { return null ; } foreach ( $ this -> translationsBackup as $ formHash => $ entities ) { foreach ( $ entities as $ entityData ) { $ entity = $ entityData [ 'object' ] ; $ entityIdGetter = $ entityData [ 'idGetter' ] ; $ entityAlias = $ entityData [ 'alias' ] ; $ fields = $ entityData [ 'fields' ] ; foreach ( $ fields as $ fieldName => $ locales ) { foreach ( $ locales as $ locale => $ translation ) { $ this -> entityTranslationProvider -> setTranslation ( $ entityAlias , $ entity -> $ entityIdGetter ( ) , $ fieldName , $ translation , $ locale ) ; } } } } $ this -> entityTranslationProvider -> flushTranslations ( ) ; }
Method executed at the end of the response. Save all entity translations
previously generated and waiting for being flushed into database and
cache layer.
Method executed at the end of the response . Save all entity translations previously generated and waiting for being flushed into database and cache layer .