Answer the question
In order to leave comments, you need to log in
How to correctly use an entity from one bundle in other bundles?
There are several bundles, each of which performs its own function, but Entity is currently used from MainBundle. How to get rid of such a hard dependency of Entity from MainBundle? Let's say if you want to use a bundle for another project, in which there are other entities, you will have to rewrite part of the code :(
Answer the question
In order to leave comments, you need to log in
If you think that the bundle can be reused, then you should not keep essences in it at all. You can provide:
- interface for entities
- base class model
- in some cases you can use traits.
In general, lately I have been trying to keep all the project code out of bundles. That is, I try to avoid such things as CoreBundle or MainBundle or AppBundle. Anyway, I don't regret it. And if I see that some code can be reused, then I can put this case into a bundle.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question