Posts Tagged: Doctrine

Symfony Doctrine To Flush or Not to Flush

I’m in the process of converting an old MySQL database to a shiny new MySQL database controlled via Doctrine. Some of the tables have tens of thousands of records in them, so I was curious if it made sense to flush after each insert, wait till the end and flush or flush periodically during the… Read more »

Symfony Doctrine Event Listener Silently Fails on instanceof

If you’ve ever done this in a Symfony doctrine event listener if ($entity instanceof User) { // Do something for this particular entity } you might have run across this annoyance. If you forgot to add a “use” statement for your “User” entity in your event listener class, this check will silently fail. I think… Read more »