/** * * @param OutputInterface $output * @param ProfileEntity $profileModel * @param string $file * @param string $format */ protected function start(OutputInterface $output, $profileModel, $file, $format) { $helper = new CommandHelper(array('profileEntity' => $profileModel, 'filePath' => $file, 'format' => $format, 'username' => 'Commandline')); $output->writeln('<info>' . sprintf("Using profile: %s.", $profileModel->getName()) . '</info>'); $output->writeln('<info>' . sprintf("Using format: %s.", $format) . '</info>'); $output->writeln('<info>' . sprintf("Using file: %s.", $file) . '</info>'); $return = $helper->prepareImport(); $count = $return['count']; $output->writeln('<info>' . sprintf("Total count: %d.", $count) . '</info>'); $return = $helper->importAction(); $position = $return['data']['position']; $output->writeln('<info>' . sprintf("Processed: %d.", $position) . '</info>'); while ($position < $count) { $return = $helper->importAction(); $position = $return['data']['position']; $output->writeln('<info>' . sprintf("Processed: %d.", $position) . '</info>'); } }
/** * @param Profile $profile */ public function __construct(Profile $profile) { $this->name = $profile->getName(); $this->type = $profile->getType(); $this->tree = json_decode($profile->getTree(), true); }