Doctrine\DBAL\Migrations\Configuration\Configuration::getVersion PHP Method

getVersion() public method

Returns the Version instance for a given version in the format YYYYMMDDHHMMSS.
public getVersion ( string $version ) : Version
$version string The version string in the format YYYYMMDDHHMMSS.
return Doctrine\DBAL\Migrations\Version
    public function getVersion($version)
    {
        if (empty($this->migrations)) {
            $this->registerMigrationsFromDirectory($this->getMigrationsDirectory());
        }
        if (!isset($this->migrations[$version])) {
            throw MigrationException::unknownMigrationVersion($version);
        }
        return $this->migrations[$version];
    }

Usage Example

 private function markVersionsMigrated()
 {
     foreach ($this->migrations->getAvailableVersions() as $versionIdentifier) {
         $version = $this->migrations->getVersion($versionIdentifier);
         $version->markMigrated();
     }
 }
All Usage Examples Of Doctrine\DBAL\Migrations\Configuration\Configuration::getVersion