/** * {@inheritdoc} */ public function populate(EntityManager $em = null) { $command = new PopulateCommand(); $command->setContainer($this->kernel->getContainer()); $output = new BufferedOutput(); $input = new ArgvInput(['env' => $this->kernel->getEnvironment()]); if ($command->run($input, $output)) { //return code is not zero throw new \RuntimeException($output->fetch()); } $this->output = $output->fetch(); return $this; }