eventDispatcher = $eventDispatcher; } protected function configure() { $this->setName('kupshop:update_shared_database') ->setDescription('Import data into shared database'); $this->addOption('method', 'm', InputOption::VALUE_OPTIONAL, 'Call specific cron method - write just method, f.e.: "-m activatePoints"', false); } protected function execute(InputInterface $input, OutputInterface $output) { $event = new SharedDBUpdateEvent(); if ($input->getOption('method') !== false) { $this->eventDispatcher->setSpecificMethod($input->getOption('method')); } $this->eventDispatcher->dispatch($event, SharedDBUpdateEvent::NAME); return 0; } }