Symfony & Doctrine: Using table joins with unassociated entities

In Symfony using Doctrine, if no association is available for two entities, you can still join them and treat them like they have a relationship.  To do so, you have to use the "Join: WITH" method.  Here's an example query to illustrate, notice the "a.user = u.id". Some other helpful links on Stack Overflow:…

MySQL “Where IN” value contained in list used with setParameter() requires value to be array if using placeholders

In normal SQL queries, you can use “WHERE IN” like this: “WHERE id IN (1,5,10)” as in: If the list 1,5,10 "contains" the value represented by the value in the "id" field. However, if you define a comma delimited string, you can’t simply do this: This will only return the first result!   However, if…

Changing getArrayResult() to getArray() fixes weird Symfony Doctrine gotcha

A strange Symfony Doctrine issue got me the other day.  I guess it's a lack of clear understanding of how Doctrine hydrates database query results when using getArrayResult() instead of getArray().  It seems that getArrayResult() returns just the first record from your query, no matter how many records the query actually returns but getArray() returns…

Laravel PHP Framework: Basic Explanation of Eloquent, Doctrine and Fluent

Sometimes, a story shares more information and conveys more insights than just spoon feeding people information.  I use Doctrine ORM a lot but was curious what Symfony-based Laravel framework used as a database ORM or if it even used one at all.  After all, in Symfony you can use custom ORM packages but Doctrine works…

Skipper ORM Database Tool Useful and Intuitive for Symfony Framework & Doctrine Users

I'll have to admit when I first started learning Symfony probably my biggest stumbling block was to get the right data from form collections to persist or update to the database correctly.  It really shouldn't be so complex, I mean, I spent a week learning the intricacies with the "let the framework do it" mentality…