Added subdir to entities directories #155

Closed
wants to merge 4 commits into
from

Projects

None yet

3 participants

@aequasi
aequasi commented Jan 26, 2013

When working with multiple entity managers, its not easy to have them all store in a single bundle. This allows for namespacing further down

@aequasi aequasi Added subdir to entities directories
When working with multiple entity managers, its not easy to have them all store in a single bundle. This allows for namespacing further down
f101560
@michaelperrin michaelperrin commented on an outdated diff Feb 5, 2013
Command/ImportMappingDoctrineCommand.php
@@ -43,6 +43,7 @@ protected function configure()
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be mapped.')
->addOption('force', null, InputOption::VALUE_NONE, 'Force to overwrite existing mapping files.')
+ ->addOption('dir', null, InputOption::VALUE_OPTION, 'Extra Namespace option. Sub directory for entities.' )
@michaelperrin
michaelperrin Feb 5, 2013

Hi! You could possibly use the 4th argument of addOption to set the default value to '', making the test on line 81 useless

@michaelperrin michaelperrin commented on an outdated diff Feb 5, 2013
Command/ImportMappingDoctrineCommand.php
@@ -111,10 +113,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln(sprintf('Importing mapping information from "<info>%s</info>" entity manager', $emName));
foreach ($metadata as $class) {
$className = $class->name;
- $class->name = $bundle->getNamespace().'\\Entity\\'.$className;
+ $class->name = $bundle->getNamespace();
+ if( !empty( $dir ) ) {
@michaelperrin
michaelperrin Feb 5, 2013

To get your PR more easily accepted and merged, use PSR-2 coding standards (https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md): if (!empty($dir)).
Concerning concatenation operator (.), there is no PSR coding standard as far as I know, but it would be better to remove surrounding spaces as the rest of the class don't have them.

@aequasi
aequasi commented Feb 5, 2013

Fixed to psr standards and added a default value. Commit messages got weird...

@aequasi
aequasi commented Oct 7, 2014

Closing, since this doesn't seem to merge, and no one cares....

@aequasi aequasi closed this Oct 7, 2014
@cordoval
Contributor
cordoval commented Oct 7, 2014

hm i just saw this. @stof maintains this maybe he missed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment