protected function execute(InputInterface $input, OutputInterface $output) { $kernel = $this->getContainer()->get('kernel'); $doctrine = $this->getContainer()->get('doctrine'); $areaScraper = new AreaScraper($kernel, $doctrine); $areaScraper->scrapeAreas(); }
/** * @Route("/areas/scrape") */ public function scrapeAreasAction() { $kernel = $this->get('kernel'); $doctrine = $this->getDoctrine(); $areaScraper = new AreaScraper($kernel, $doctrine); $areaScraper->scrapeAreas(); return new Response(); }