protected function doExecute(BundleInterface $bundle, $force, $methodToCall, OutputInterface $output) { $starttime = microtime(true); $message = null; if ($force) { $message = "\n\n" . sprintf(' โ %s of bundle "%s" started.', ucfirst($this->getCommandType()), $bundle->getId()) . "\n\n"; } else { $message = "\n\n" . sprintf(' โ Getting information about %s of bundle "%s"...', $this->getCommandType(), $bundle->getId()) . "\n\n"; } $output->writeln($message); $logs = $this->getContainer()->get('bundle.loader')->{$methodToCall}($bundle, $force); if ($force) { $output->writeln(sprintf(' โ %s of bundle "%s" completed in %s.', ucfirst($this->getCommandType()), $bundle->getId(), number_format(microtime(true) - $starttime, 3) . ' s') . "\n\n"); } $output->writeln('SQL:' . (0 < count($logs['sql']) ? '' : ' -')); foreach ($logs['sql'] as $sql) { $output->writeln($sql); } unset($logs['sql']); foreach ($logs as $key => $other) { foreach ((array) $other as $message) { $output->writeln(sprintf('[%s] %s', ucfirst($key), $message)); } } }
/** * Returns bundle entity directory path. * * @param BundleInterface $bundle * @return string */ protected function getBundleEntityDir(BundleInterface $bundle) { return $bundle->getBaseDirectory() . DIRECTORY_SEPARATOR . 'Entity'; }