protected function execute(InputInterface $input, OutputInterface $output) { // get list of URL $em = $this->getContainer()->get('doctrine.orm.entity_manager'); $dataWindPrevList = $em->getRepository('LaPoizWindBundle:DataWindPrev')->findAll(); foreach ($dataWindPrevList as $dataWindPrev) { if ($dataWindPrev->getWebSite()->getNom() == WebsiteGetData::windFinderName) { GetDataCommand::getDataFromDataWindPrev($dataWindPrev, $output, $em); } } }
protected function execute(InputInterface $input, OutputInterface $output) { // get list of URL $em = $this->getContainer()->get('doctrine.orm.entity_manager'); $dataWindPrevList = $em->getRepository('LaPoizWindBundle:DataWindPrev')->findAll(); foreach ($dataWindPrevList as $dataWindPrev) { try { GetDataCommand::getDataFromDataWindPrev($dataWindPrev, $output, $em); } catch (\Exception $e) { $output->writeln('<error>' . $e->getMessage() . '</error>'); } } // Get Marée $spotList = $em->getRepository('LaPoizWindBundle:Spot')->findAll(); $output->writeln('<info>************** GET MAREE ****************</info>'); foreach ($spotList as $spot) { if ($spot->getMareeURL() != null) { //$prevMaree = MareeGetData::getMaree($spot->getMareeURL()); $prevMaree = MareeGetData::getMareeForXDays($spot->getMareeURL(), 10, $output); MareeGetData::saveMaree($spot, $prevMaree, $em, $output); } } }