コード例 #1
0
 /**
  * Stores config to yml config
  *
  * @param RestoreJob $job
  * @param OutputInterface $output
  * @author Daniel Wendlandt
  */
 private function storeConfig(RestoreJob $job, OutputInterface $output)
 {
     $mappingActions = array();
     foreach ($job->getStrategy()->getMappings() as $types) {
         /** @var RestoreStrategy\MappingAction $mappingAction */
         foreach ($types as $mappingAction) {
             $mappingActions[] = $mappingAction->toArray();
         }
     }
     $config = array('name' => $job->getName(), 'source' => $job->getSource(), 'host' => $job->getHost(), 'port' => $job->getPort(), 'create_config' => $job->isCreateConfig(), 'config_name' => $job->getConfigName(), 'strategy' => array('strategy' => $job->getStrategy()->getStrategy(), 'mappings' => $mappingActions), 'created_at' => $job->getCreatedAt()->format('Y-m-d H:i:s'));
     $this->filesystem->storeRestoreConfig($job, $config);
     $output->writeln('<info>*** Stored restore-config to file in yaml format ***</info>' . PHP_EOL);
 }