Doctrine Query Builder mysql Functions

im atempting to create one of my old mysql queries in Doctrine Query Builder however im getting back an error Error: Expected known function, got ‘SEC_TO_TIME’

So im guessing that doctrine doesnt like the mysql function SEC_TO_TIME however it does seem to like AVG, COUNT and such. Is there any way apart form using the Doctrine_RawSQL class of getting the query builder to run the query?

Thanks

Answer

Those AVG and Count are DQL aggregate functions, they have nothing to do with SQL. So there is no way to call UDF’s from DQL, except for RawSQL

But, if you are using doctrine2, you might want to have a look at Adding your own functions to the DQL language and Extending DQL in Doctrine 2: User-Defined Functions.