protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) { $em = $this->getHelper('em')->getEntityManager(); if (($handle = fopen(DATADIR . "/teams/TEAMABR.TXT", "r")) !== FALSE) { while (($data = fgetcsv($handle)) !== FALSE) { $team = new \BBM\Team($data[0]); $team->setLeague($data[1]); $team->setCity($data[2]); $team->setNickname($data[3]); $output->writeln($team); $em->persist($team); } } $em->flush(); }
public function setLeague($league) { $this->_load(); return parent::setLeague($league); }