|Retrieve a doctrine field type [message #103202]
||Wed, 28 July 2010 16:18
Registered: January 2010
I would like to retrieve the type of a doctrine field.
I know this is possible by retrieving the table columns and then getting their type, but my proces is a little bit more complicated.
I receive a doctrine query like:
->select('a.name ,a.created_at creation, c.name category')
And I would like to transform it into an HTML table.
If the type of my column (for example creation) is a timestamp, I would like it to be displayed in a French way ('d/m/Y'), if it is boolean, I would like it to be displayed with Oui/Non etc...
The problem is that I can't test the type of the variable I retrieve with the getCreated() method for example (thanks to PHP non-typed variables).
Is there a way to do this or simply to retrieve the type of a doctrine field ? I could try to find the TableModel associated with the query, then retrieve the columns, then their type etc.. but this is really complex and furthermore, I can't retrieve the type of a Joined column (like category in my example).
Thanks in advance