public function execute( )
    {
        $this->doAction( self::ON_BEFORE_MIGRATE_CMD_EXECUTE_ACTION );
        
        if ( NULL === $this->migrator )
        {
            throw new MigrationException( 'You must set the migrator before executing this command.' );
        }
        
        $verbose   = self::getOption( $this, 'verbose' )->value;
        
        $direction = self::getOption( $this, 'direction' )->value;
        $levels    = self::getOption( $this, 'levels' )->value;
        
        $this->migrator->verbose = $verbose;
        
        switch( $direction )
        {
            case 'up':
                $this->migrator->migrateUp( $levels );
                break;
            
            case 'down':
                $this->migrator->migrateDown( $levels );
                break;
            
            default:
                // do nothing
                break;
        }
        
        $this->doAction( self::ON_AFTER_MIGRATE_CMD_EXECUTE_ACTION );
    }
public function execute( )
    {
        $this->doAction( self::ON_BEFORE_MIGRATE_CMD_EXECUTE_ACTION );
        
        if ( NULL === $this->migrator )
        {
            throw new MigrationException( 'You must set the migrator before executing this command.' );
        }
        
        $verbose   = self::getOption( $this, 'verbose' )->value;
        
        $direction = self::getOption( $this, 'direction' )->value;
        $levels    = self::getOption( $this, 'levels' )->value;
        
        $this->migrator->verbose = $verbose;
        
        switch( $direction )
        {
            case 'up':
                $this->migrator->migrateUp( $levels );
                break;
            
            case 'down':
                $this->migrator->migrateDown( $levels );
                break;
            
            default:
                // do nothing
                break;
        }
        
        $this->doAction( self::ON_AFTER_MIGRATE_CMD_EXECUTE_ACTION );
    }
public function execute ( ) { $ this -> doAction ( self :: ON_BEFORE_MIGRATE_CMD_EXECUTE_ACTION ) ; if ( NULL === $ this -> migrator ) { throw new MigrationException ( 'You must set the migrator before executing this command.' ) ; } $ verbose = self :: getOption ( $ this , 'verbose' ) -> value ; $ direction = self :: getOption ( $ this , 'direction' ) -> value ; $ levels = self :: getOption ( $ this , 'levels' ) -> value ; $ this -> migrator -> verbose = $ verbose ; switch ( $ direction ) { case 'up' : $ this -> migrator -> migrateUp ( $ levels ) ; break ; case 'down' : $ this -> migrator -> migrateDown ( $ levels ) ; break ; default : // do nothing break ; } $ this -> doAction ( self :: ON_AFTER_MIGRATE_CMD_EXECUTE_ACTION ) ; }
Executes the command action.

@action ON_BEFORE_MIGRATE_CMD_EXECUTE_ACTION
@action ON_AFTER_MIGRATE_CMD_EXECUTE_ACTION

@throws MigrationException if the migrator hasn't been set
Executes the command action .