Skip to content

Commit

Permalink
added ability to choose entity manager
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-hirewheel committed Dec 7, 2015
1 parent 8c1e8f3 commit 0b11090
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Command/IndexUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class IndexUpdateCommand extends Command

const DUMPSQL = 'dump-sql';

const EM = 'em';

// array with abstract classes
protected $abstractClasses = [];

Expand All @@ -38,6 +40,7 @@ protected function configure()
$this
->setName('intaro:doctrine:index:update')
->addOption(self::DUMPSQL, null, InputOption::VALUE_NONE, 'Dump sql instead creating index')
->addOption(self::EM, null, InputOption::VALUE_OPTIONAL, 'Entity manager to load')
->setDescription('Create new and drop not existing custom indexes');
}

Expand All @@ -51,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

$kernel = $this->getApplication()->getKernel();
$container = $kernel->getContainer();
$em = $container->get('doctrine')->getManager();
$em = $container->get('doctrine')->getManager($this->input->getOption(self::EM));
$this->validator = $container->get('validator');
$connection = $em->getConnection();

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "intaro/custom-index-bundle",
"description": "Annotation and command for control entity custom indexes",
"name": "hirewheel/custom-index-bundle",
"description": "Postgres Custom Indexes: Adapted from Intaro Custom Index Bundle",
"keywords": ["symfony2", "index", "postgresql-index"],
"type": "symfony-bundle",
"license": "MIT",
"authors": [{
"name": "Chernyavtsev Ivan",
"email": "chernyavtsev@intaro.ru",
"name": "Hirewheel",
"email": "support@hirewheel.com",
"role": "Developer"
}],
"require": {
Expand Down

0 comments on commit 0b11090

Please sign in to comment.