In a Symfony2.8/Doctrine2 application, I need to store in each row of my SQL tables the id of the user who created or updated the row (users can connect with Ldap).
So al
@ORM\PrePersist
and other callback methods used in the entity are suppose to contain simple logic and be independant of other services.
You need to create event listener or subscriber to listen postPersist
doctrine event and fill in corresponding attribute. Check How to Register Event Listeners and Subscribers