-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
AbstractCommand - assert accept only instanceof EntityManager #8488
Comments
Same here. Looks like this happens since v2.8.2, as v2.8.1 doesn't throw |
EntityManager is too restrictive, any implementation can actually be returned here. Closes doctrine#8488
EntityManager is too restrictive, any implementation can actually be returned here. Closes doctrine#8488
EntityManager is too restrictive, any implementation can actually be returned here. Closes doctrine#8488
EntityManager is too restrictive, any implementation can actually be returned here. Closes #8488
Out of curiosity, what is used there if not |
In my case yes, a decorator. It extends from this https://github.com/doctrine/orm/blob/2.8.x/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php |
@acelaya what is the decorators purpose? Can you explain? |
Sure! I serve my application with swoole. Since it keeps services in memory to reuse them on subsequent requests, it can happen that the EntityManager has been closed for some reason, or the connection with the database has expired. What my decorator does is allow to transparently recreate the wrapped EntityManager if needed. To simplify things, I do this by exposing an The project is open source, so you can see the code here:
|
AbstractCommand, line 56
Accept only EntityManager instances:
Should be:
The text was updated successfully, but these errors were encountered: