dispatcher = $dispatcher; $this->em = $em; } public function update() { $connection = $this->em->getConnection(); $connection->getConfiguration()->setSQLLogger(null); $schema = $connection->getSchemaManager(); collect($schema->listTables())->reject(function (Table $schema) { return $schema->getName() === 'migration_versions'; })->each([$schema, 'dropAndCreateTable']); $this->dispatcher->dispatch(self::UPDATE_EVENT, new DataUpdateEvent()); } }