/**
  * {@inheritDoc}
  */
 protected function doExecute(MigrateCommand $command, callable $next)
 {
     $migration = $command->getMigration();
     if ($migration instanceof OptionsAwareInterface) {
         $migration->setOptions($command->getOptions());
     }
     return $next($command);
 }
 /**
  * {@inheritDoc}
  */
 protected function doExecute(MigrateCommand $command, callable $next)
 {
     $migration = $command->getMigration();
     if (!$migration instanceof TransactionAwareInterface) {
         return $next($command);
     }
     $result = null;
     try {
         $migration->begin();
         $result = $next($command);
         $migration->finish();
     } catch (\Exception $e) {
         $migration->abort($e);
     }
     return $result;
 }
Пример #3
0
 /**
  * {@inheritDoc}
  */
 public function doExecute(MigrateCommand $command, callable $next)
 {
     $migration = $command->getMigration();
     $direction = $command->getOptions()->getDirection();
     $migration->{$direction}();
 }