Christopher Shennan's Blog

A day in the life of…

Browsing Posts tagged doctrine

You have probably come across this already but I have tripped up over this problem a few times.

If you have fields in the db like address_1, address_2, address_3 then the _ is not removed when using getter/setter methods

continue reading…

A week or so I got an unexpected email from Ludek Vodicka asking me to have a look at ORM Designer for creating and maintaining my database schemas for the Symfony projects I have been working on.  Up until now I have been using MySQL Workbench to create my ER-diagrams and maintain my database structure but I’ve come up against a few obstacles when trying to use it with projects using doctrine so I thought why now.

I fully expected ORM Designer to be a MySQL Workbench clone (and it’s obviously been a question that has been raised before – ORM Designer and MySQL Workbench comparison) but I must admit I was pleasantly surprised to find out is was not.  To try and break myself into it easily I opted to start working on the database schema for the re-build of Manage My Alerts which I have intended to re-build using Symfony for quite a while.
continue reading…

This has been updated to work with Symfony 1.3/1.4 – Please go to the updated article: Raw SQL from Doctrine Query Object – Revised

As my use of Symfony is increasing I find myself frustrated that there doesn’t appear to be an easy way to get the raw SQL from a doctrine query object so I can simply output it and paste it into phpMyAdmin to debug problems with the SQL. I may be wrong about this but as yet I have not found a built in function to perform this operation.

Sure I am able to output the query with the “?” indicating where the necessary values are to go and I can also easily output the array of query parameters so I can substitute these manually but this takes time and it would be much much simpler and quicker to just output the whole query with the substitution already done so it’s a simply copy and paste of the raw SQL from the doctrine query object straight into phpMyAdmin.

I have wrote a quick function to do this and I had meant to post this for a while but I just have not had the chance to get round to it until now.
continue reading…