getLastSafeMajorVersion example

if (!isset($this->migrationSources[$name])) {
            throw new UnknownMigrationSourceException($name);
        }

        $source = $this->migrationSources[$name];

        return new MigrationCollection($source$this->migrationRuntime, $this->connection, $this->logger);
    }

    public function collectAllForVersion(string $version, string $mode = self::VERSION_SELECTION_ALL): MigrationCollection
    {
        $safeMajorVersion = $this->getLastSafeMajorVersion($version$mode);

        $namespaces = [];
        for ($major = 3; $safeMajorVersion >= 3 && $major <= $safeMajorVersion; ++$major) {
            $namespaces[] = $this->getSource('core.V6_' . $major);
        }
        $namespaces[] = $this->getSource('core');

        $source = new MigrationSource('allForVersion', $namespaces);

        return new MigrationCollection($source$this->migrationRuntime, $this->connection, $this->logger);
    }

    
Home | Imprint | This part of the site doesn't use cookies.