src/Extension/FluentVersionedExtension.php
public function augmentWrite(&$manipulation)
    {
        parent::augmentWrite($manipulation);

        // Only rewrite if the locale is valid
        $locale = Locale::getCurrentLocale();
        if (!$locale) {
            return;
        }

        // Get all tables to translate fields for, and their respective field names
        $includedTables = $this->getLocalisedTables();
        foreach ($includedTables as $table => $localisedFields) {
            // Localise both _Versions and _Live writes
            foreach ([self::SUFFIX_LIVE, self::SUFFIX_VERSIONS] as $suffix) {
                $versionedTable = $table . $suffix;
                $localisedTable = $this->getLocalisedTable($table) . $suffix;

                // Add extra case for "Version" column when localising Versions
                $localisedVersionFields = $localisedFields;
                if ($suffix === self::SUFFIX_VERSIONS) {
                    $localisedVersionFields = array_merge(
                        $localisedVersionFields,
                        array_keys($this->defaultVersionsFields)
                    );
                }

                // Rewrite manipulation
                $this->localiseManipulationTable(
                    $manipulation,
                    $versionedTable,
                    $localisedTable,
                    $localisedVersionFields,
                    $locale
                );
            }
        }
    }
public function augmentWrite(&$manipulation)
    {
        parent::augmentWrite($manipulation);

        // Only rewrite if the locale is valid
        $locale = Locale::getCurrentLocale();
        if (!$locale) {
            return;
        }

        // Get all tables to translate fields for, and their respective field names
        $includedTables = $this->getLocalisedTables();
        foreach ($includedTables as $table => $localisedFields) {
            // Localise both _Versions and _Live writes
            foreach ([self::SUFFIX_LIVE, self::SUFFIX_VERSIONS] as $suffix) {
                $versionedTable = $table . $suffix;
                $localisedTable = $this->getLocalisedTable($table) . $suffix;

                // Add extra case for "Version" column when localising Versions
                $localisedVersionFields = $localisedFields;
                if ($suffix === self::SUFFIX_VERSIONS) {
                    $localisedVersionFields = array_merge(
                        $localisedVersionFields,
                        array_keys($this->defaultVersionsFields)
                    );
                }

                // Rewrite manipulation
                $this->localiseManipulationTable(
                    $manipulation,
                    $versionedTable,
                    $localisedTable,
                    $localisedVersionFields,
                    $locale
                );
            }
        }
    }
public function augmentWrite ( & $ manipulation ) { parent :: augmentWrite ( $ manipulation ) ; // Only rewrite if the locale is valid $ locale = Locale :: getCurrentLocale ( ) ; if ( ! $ locale ) { return ; } // Get all tables to translate fields for, and their respective field names $ includedTables = $ this -> getLocalisedTables ( ) ; foreach ( $ includedTables as $ table => $ localisedFields ) { // Localise both _Versions and _Live writes foreach ( [ self :: SUFFIX_LIVE , self :: SUFFIX_VERSIONS ] as $ suffix ) { $ versionedTable = $ table . $ suffix ; $ localisedTable = $ this -> getLocalisedTable ( $ table ) . $ suffix ; // Add extra case for "Version" column when localising Versions $ localisedVersionFields = $ localisedFields ; if ( $ suffix === self :: SUFFIX_VERSIONS ) { $ localisedVersionFields = array_merge ( $ localisedVersionFields , array_keys ( $ this -> defaultVersionsFields ) ) ; } // Rewrite manipulation $ this -> localiseManipulationTable ( $ manipulation , $ versionedTable , $ localisedTable , $ localisedVersionFields , $ locale ) ; } } }
Apply versioning to write

@param array $manipulation
Apply versioning to write