示例#1
0
 public function __construct(Version $version)
 {
     $this->_configuration = $version->getConfiguration();
     $this->_outputWriter = $this->_configuration->getOutputWriter();
     $this->_connection = $this->_configuration->getConnection();
     $this->_sm = $this->_connection->getSchemaManager();
     $this->_platform = $this->_connection->getDatabasePlatform();
     $this->_version = $version;
 }
示例#2
0
 /**
  * Register a single migration version to be executed by a AbstractMigration
  * class.
  *
  * @param string $version  The version of the migration in the format YYYYMMDDHHMMSS.
  * @param string $class    The migration class to execute for the version.
  */
 public function registerMigration($version, $class)
 {
     $version = (string) $version;
     $class = (string) $class;
     if (isset($this->_migrations[$version])) {
         throw MigrationException::duplicateMigrationVersion($version, get_class($this->_migrations[$version]));
     }
     $version = new Version($this, $version, $class);
     $this->_migrations[$version->getVersion()] = $version;
     ksort($this->_migrations);
     return $version;
 }