Tag

ORMs

2 posts tagged ORMs.

Posts

  • Diagram: a loop firing fifty queries at a database, compared against the same loop firing one query after addSelect().

    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.

  • Diagram: Doctrine's flush() taking two paths, a silent commit or a thrown exception that has to be caught by type.

    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