/** * @param HelperSet $helperSet * * @return array */ public function getConsoleCommands(HelperSet $helperSet) { $configuration = new Configuration($this->em->getConnection()); $configuration->setMigrationsNamespace($this->config->getMigrationsNamespace()); $configuration->setMigrationsDirectory($this->config->getMigrationsPath()); $configuration->setMigrationsTableName($this->config->getMigrationsTable()); $commands = [new DiffCommand(), new ExecuteCommand(), new GenerateCommand(), new LatestCommand(), new MigrateCommand(), new StatusCommand(), new VersionCommand()]; /** @var AbstractCommand $command */ foreach ($commands as $command) { $command->setHelperSet($helperSet); $command->setMigrationConfiguration($configuration); } return $commands; }
/** * @param IDoctrineConfig $config * * @return int */ protected function getProxyClassesGenerationStrategy(IDoctrineConfig $config) { if ($config->getDebug()) { return AbstractProxyFactory::AUTOGENERATE_ALWAYS; } else { return AbstractProxyFactory::AUTOGENERATE_FILE_NOT_EXISTS; } }