diff --git a/Command/PopulateCommand.php b/Command/PopulateCommand.php index 026465b..0f0d3a9 100644 --- a/Command/PopulateCommand.php +++ b/Command/PopulateCommand.php @@ -19,6 +19,13 @@ */ class PopulateCommand extends ContainerAwareCommand { + private $populator; + + public function setPopulator($populator) + { + $this->populator = $populator; + } + /** * {@inheritDoc} */ @@ -41,8 +48,7 @@ protected function configure() */ protected function execute(InputInterface $input, OutputInterface $output) { - $populator = $this->getContainer()->get('faker.populator'); - $insertedPks = $populator->execute(); + $insertedPks = $this->populator->execute(); $output->writeln(''); diff --git a/Resources/config/services.xml b/Resources/config/services.xml index f03529b..c9dab70 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -27,6 +27,9 @@ + + +