I have a Student model that is associated with many Transfer elements in Symfony2 using Doctrine.
How can I effectively use the last Transfer element that is associated with the current Student?
That is, for example, creating a method of type getLastTransfer () in the Student class.
I heard that it is not recommended to use an entity manager inside a modal to be able to use dependency injection on it, etc.
thanks
source share