/** * Set the service container, and initialize the command. * * @param ContainerInterface $container */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); $this->templating = $container->get('templating'); $this->logger = $container->get('monolog.logger.processing'); $this->ping = $container->get('ping'); }
/** * Set the service container, and initialize the command. * * @param ContainerInterface $container */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); $this->templating = $container->get('templating'); $this->logger = $container->get('logger'); $this->em = $container->get('doctrine')->getManager(); }
/** * {@inheritdoc} */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); $this->logger = $container->get('logger'); $this->em = $container->get('doctrine')->getManager(); $this->filePaths = $container->get('filepaths'); }
/** * Set the service container, and initialize the command. * * @param ContainerInterface $container */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); $this->logger = $container->get('monolog.logger.processing'); $this->em = $container->get('doctrine')->getManager(); $this->filePaths = $container->get('filepaths'); $this->swordClient = $container->get('sword_client'); $this->fs = new Filesystem(); }
public function setContainer(ContainerInterface $container = NULL) { parent::setContainer($container); //Set up some shortcuts to services if ($container !== NULL) { $this->_em = $container->get("doctrine.orm.entity_manager"); $this->resultRepo = $this->_em->getRepository("OverwatchResultBundle:TestResult"); } }
/** * Executes specified command. * * @param ContainerAwareCommand $commandInstance * @param string $commandNamespace * @param array $parameters * * @return CommandTester */ protected function executeCommand(ContainerAwareCommand $commandInstance, $commandNamespace, array $parameters = []) { $application = new Application(self::createClient()->getKernel()); $commandInstance->setContainer($this->getServiceContainer()); $application->add($commandInstance); $command = $application->find($commandNamespace); $commandTester = new CommandTester($command); $commandTester->execute(array_merge_recursive(['command' => $command->getName()], $parameters)); return $commandTester; }
/** * Set the service container, and initialize the command. * * @param ContainerInterface $container */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); $this->logger = $container->get('monolog.logger.processing'); $this->em = $container->get('doctrine')->getManager(); }
/** * @param string $command * @param string $controller * @param \Symfony\Component\DependencyInjection\ContainerInterface $container */ function __construct($command, $controller, ContainerInterface $container) { $this->command = new $command(); $this->command->setContainer($container); $this->controller = $controller; }
/** * {@inheritdoc} * * @InjectParams({ * "container" = @Inject("service_container") * }) */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); }
/** * Runs a command and returns a response if there was an error. * * @param ContainerAwareCommand $command * @param InputInterface|null $input * * @return Response|null */ private function runCommand(ContainerAwareCommand $command, InputInterface $input = null) { if (null === $input) { $input = new ArgvInput([]); } $output = new BufferedOutput(OutputInterface::VERBOSITY_NORMAL, true); $command->setContainer($this->container); $status = $command->run($input, $output); if ($status > 0) { return $this->render('console.html.twig', ['output' => $output->fetch()]); } return null; }
/** * @param ContainerInterface|null $container */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); $this->_consulBag = $container->get('consul_api.bag'); }