This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » Retrieve a doctrine field type
Retrieve a doctrine field type [message #103202] Wed, 28 July 2010 16:18
bgu-k  is currently offline bgu-k
Messages: 2
Registered: January 2010
Junior Member
Hi everyone,

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:

$q= Doctrine_Query::create()
->select('a.name ,a.created_at creation, c.name category')
->from('Object a')
->leftJoin('a.Category c');


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 Smile
Previous Topic:how to use new plugins in symfony1.4
Next Topic:[SOLVED] propel - modified fields, old values
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software