From 0b11090b1eb55b2f905d354f9be225cb255ad085 Mon Sep 17 00:00:00 2001 From: Drew Gurley Date: Mon, 7 Dec 2015 10:39:58 -0500 Subject: [PATCH] added ability to choose entity manager --- Command/IndexUpdateCommand.php | 5 ++++- composer.json | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Command/IndexUpdateCommand.php b/Command/IndexUpdateCommand.php index f8e6465..f40bac1 100644 --- a/Command/IndexUpdateCommand.php +++ b/Command/IndexUpdateCommand.php @@ -21,6 +21,8 @@ class IndexUpdateCommand extends Command const DUMPSQL = 'dump-sql'; + const EM = 'em'; + // array with abstract classes protected $abstractClasses = []; @@ -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'); } @@ -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(); diff --git a/composer.json b/composer.json index 595f440..ba5ceb1 100644 --- a/composer.json +++ b/composer.json @@ -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": {