/** * {@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; }
/** * {@inheritDoc} */ public function doExecute(MigrateCommand $command, callable $next) { $migration = $command->getMigration(); $direction = $command->getOptions()->getDirection(); $migration->{$direction}(); }