Modify doctrine integration manner #285
Closed
+130
−177
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #284
As I explained at above issue, current Doctrine integration way has issue that cache is invalidate every time on Symfony 3.3.
The direct cause of the problem seems to be DIC builder/compiler can't recognize EntityManager existence since it's never loaded unless it's not retrieved from built DIC itself.
And I sought out whether there's some workaround or not, but I could not.
However during I was looking down upon integration way around, I realized a fact that the tweaking EM of this bundle is just overriding its
getRepository
.So I wanna introduce an another way of expanding this method here.
I repealed:
And I changed:
ContainerAwareRepositoryFactoryDecorator
: implementingRepositoryFactory
and wrapping the factory DoctrineBundle structuredand doing integration with ORM something what this bundle was doing originally (using CG package)
Drop support older (< 2.4) doctrine implicitly
The RepositoryFactory of Doctrine/ORM capability was introduced in 2.4, so we cannot support compatibility with 2.3 (or older) anymore.