Skip to content

Commit

Permalink
Adding setLogger for data fixtures.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwage authored and fabpot committed Oct 5, 2010
1 parent ff683a6 commit 3bc3115
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$fixtures = $loader->getFixtures();
$purger = new \Doctrine\Common\DataFixtures\Purger\ORMPurger($em);
$executor = new \Doctrine\Common\DataFixtures\Executor\ORMExecutor($em, $purger);
$executor->setLogger(function($message) use ($output) {
$output->writeln(sprintf(' <comment>></comment> <info>%s</info>', $message));
});
$executor->execute($fixtures, $input->getOption('append'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$fixtures = $loader->getFixtures();
$purger = new \Doctrine\Common\DataFixtures\Purger\MongoDBPurger($dm);
$executor = new \Doctrine\Common\DataFixtures\Executor\MongoDBExecutor($dm, $purger);
$executor->setLogger(function($message) use ($output) {
$output->writeln(sprintf(' <comment>></comment> <info>%s</info>', $message));
});
$executor->execute($fixtures, $input->getOption('append'));
}
}

0 comments on commit 3bc3115

Please sign in to comment.