Piwik\Columns\Updater::mixinVersions PHP Method

mixinVersions() private method

private mixinVersions ( Updater $updater, Piwik\Plugin\Dimension\ActionDimension | Piwik\Plugin\Dimension\ConversionDimension | Piwik\Plugin\Dimension\VisitDimension $dimension, string $componentPrefix, array $columns, array $versions ) : array
$updater Piwik\Updater
$dimension Piwik\Plugin\Dimension\ActionDimension | Piwik\Plugin\Dimension\ConversionDimension | Piwik\Plugin\Dimension\VisitDimension
$componentPrefix string
$columns array
$versions array
return array The modified versions array
    private function mixinVersions(PiwikUpdater $updater, $dimension, $componentPrefix, $columns, $versions)
    {
        $columnName = $dimension->getColumnName();
        // dimensions w/o columns do not need DB updates
        if (!$columnName || !$dimension->hasColumnType()) {
            return $versions;
        }
        $component = $componentPrefix . $columnName;
        $version = $dimension->getVersion();
        // if the column exists in the table, but has no associated version, and was one of the core columns
        // that was moved when the dimension refactor took place, then:
        // - set the installed version in the DB to the current code version
        // - and do not check for updates since we just set the version to the latest
        if (array_key_exists($columnName, $columns) && false === $updater->getCurrentComponentVersion($component) && self::wasDimensionMovedFromCoreToPlugin($component, $version)) {
            $updater->markComponentSuccessfullyUpdated($component, $version);
            return $versions;
        }
        $versions[$component] = $version;
        return $versions;
    }