protected function registerEventCommands() { $this->kernel->getContainer()->load('plugins'); /** @var \Enlight_Event_EventManager $eventManager */ $eventManager = $this->kernel->getContainer()->get('events'); $collection = new ArrayCollection(); $collection = $eventManager->collect('Shopware_Console_Add_Command', $collection, array('subject' => $this)); /** @var $command Command */ foreach ($collection as $command) { if ($command instanceof Command) { $this->add($command); } } }
/** * Returns HttpKernel service container. * * @return ContainerInterface */ public function getContainer() { return $this->kernel->getContainer(); }