Tag

ORMs

2 posts tagged ORMs.

  • The N+1 you wrote in a Twig loop, and its fix

    09/02/2026

    The N+1 you wrote in a Twig loop, and its fix

    The query looks fine and the template looks fine. Together they issue one query per row, because a lazy association is loaded the moment a template touches it - and templates touch things the controller never did.

  • Knowing whether a Doctrine insert or update worked

    11/19/2013

    Knowing whether a Doctrine insert or update worked

    Doctrine has no return value to check after flush() - it signals failure by throwing. Wrapping it is the right instinct, but the version of this snippet that has been circulating since 2013 catches nothing at all.

Often tagged together with