public function createMigration( )
    {
        $date = new \DateTime();
        
        $tStamp = substr( $date->format( 'U' ), 2 );
        
        if ( self::STYLE_CAMEL_CASE !== $this->migrationClassStyle )
        {
            $parts = preg_split('/(?=[A-Z])/', $this->migrationClass, -1, PREG_SPLIT_NO_EMPTY);
            
            $className = $this->classPrefix . '_' . $tStamp . '_' . implode( '_', $parts );
        }
        else
        {
            $className = $this->classPrefix . $tStamp . $this->migrationClass;
        }
        
        $template = $this->getMigrationTemplate( $className );
        
        $path = $this->migrationPath . $className . '.php';
        
        $template = $this->filter( self::ON_CREATE_MIGRATION_FILTER, $template );
        
        if ( ( file_exists( $path ) && $this->overwrite ) || !file_exists( $path ) )
        {
            $result = file_put_contents( $path, $template );
        }
        elseif ( file_exists( $path ) )
        {
            throw new MigrationException( 'Migration file already exists' );
        }
        
        $this->doAction( self::ON_CREATE_MIGRATION_ACTION );
        
        return FALSE !== $result;
    }
public function createMigration( )
    {
        $date = new \DateTime();
        
        $tStamp = substr( $date->format( 'U' ), 2 );
        
        if ( self::STYLE_CAMEL_CASE !== $this->migrationClassStyle )
        {
            $parts = preg_split('/(?=[A-Z])/', $this->migrationClass, -1, PREG_SPLIT_NO_EMPTY);
            
            $className = $this->classPrefix . '_' . $tStamp . '_' . implode( '_', $parts );
        }
        else
        {
            $className = $this->classPrefix . $tStamp . $this->migrationClass;
        }
        
        $template = $this->getMigrationTemplate( $className );
        
        $path = $this->migrationPath . $className . '.php';
        
        $template = $this->filter( self::ON_CREATE_MIGRATION_FILTER, $template );
        
        if ( ( file_exists( $path ) && $this->overwrite ) || !file_exists( $path ) )
        {
            $result = file_put_contents( $path, $template );
        }
        elseif ( file_exists( $path ) )
        {
            throw new MigrationException( 'Migration file already exists' );
        }
        
        $this->doAction( self::ON_CREATE_MIGRATION_ACTION );
        
        return FALSE !== $result;
    }
public function createMigration ( ) { $ date = new \ DateTime ( ) ; $ tStamp = substr ( $ date -> format ( 'U' ) , 2 ) ; if ( self :: STYLE_CAMEL_CASE !== $ this -> migrationClassStyle ) { $ parts = preg_split ( '/(?=[A-Z])/' , $ this -> migrationClass , - 1 , PREG_SPLIT_NO_EMPTY ) ; $ className = $ this -> classPrefix . '_' . $ tStamp . '_' . implode ( '_' , $ parts ) ; } else { $ className = $ this -> classPrefix . $ tStamp . $ this -> migrationClass ; } $ template = $ this -> getMigrationTemplate ( $ className ) ; $ path = $ this -> migrationPath . $ className . '.php' ; $ template = $ this -> filter ( self :: ON_CREATE_MIGRATION_FILTER , $ template ) ; if ( ( file_exists ( $ path ) && $ this -> overwrite ) || ! file_exists ( $ path ) ) { $ result = file_put_contents ( $ path , $ template ) ; } elseif ( file_exists ( $ path ) ) { throw new MigrationException ( 'Migration file already exists' ) ; } $ this -> doAction ( self :: ON_CREATE_MIGRATION_ACTION ) ; return FALSE !== $ result ; }
Creates a new migration class file.

@filter ON_CREATE_MIGRATION_FILTER

@action ON_CREATE_MIGRATION_ACTION

@return bool TRUE on success, FALSE on failure

@throws MigrationException if configuration is missing
Creates a new migration class file .