Doctrine – How to print out the real sql, not just the prepared statement?

We’re using Doctrine, a PHP ORM. I am creating a query like this: $q = Doctrine_Query::create()->select(‘id’)->from(‘MyTable’); and then in the function I’m adding in various where clauses and things as appropriate, like this $q->where(‘normalisedname = ? OR name = ?’, array($string, $originalString)); Later on, before execute()-ing that query object, I want to print out the … Read more

Doctrine2: Best way to handle many-to-many with extra columns in reference table

I’m wondering what’s the best, the cleanest and the most simply way to work with many-to-many relations in Doctrine2. Let’s assume that we’ve got an album like Master of Puppets by Metallica with several tracks. But please note the fact that one track might appears in more that one album, like Battery by Metallica does … Read more