-
-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make DoctrineBundle compatible with ORM 2.9 #1327
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nitpick. This PR LGTM otherwise, thanks for doing it 👍 Merge with squash.
/** | ||
* @return MockObject|Kernel | ||
*/ | ||
private function setupKernelMocks() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return type should still be added for either Kernel or MockObject
Also note the parent option has default value while this has none. ->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on', 'default') I'm not entirely sure whats correct, though having default set as
Issue for this doctrine/orm#8643 |
@simPod hm thats annoying, i didn't want to make the manager name nullable in ORM if it could be avoided. :( Seems it is necessary just for backwards compatibility in Bundle |
Understand. I'm using only one EM for now (used to have more so it has custom name). Though it's not working with this change and it requires to specify |
445431b
to
bd181de
Compare
bd181de
to
7dbc5e4
Compare
Co-authored-by: Gabriel Ostrolucký <gabriel.ostrolucky@gmail.com>
In ORM 2.9 similar to DBAL 2.11 we introduce a new way of injecting the
EntityManager
into commands via registries/providers. These register the optionem
, which would lead to conflicts in the proxy commands due to redefinition of the option.The same change was already made for dbal in 86d2469
Once ORM 2.9 is out we can think of increasing the
doctrine/orm
dependency from 2.6 to 2.9, since both support PHP 7.1. Then we can replace the whole proxy command code with proper dependency injection and shipping an entity manager provider.This PR adds one test for one proxy command to test the variable entity manager option behavior. In addition since commands are services for a while already, the
ContainerTest
is also extended to fetch two out of the container