How can I use DATE() in Doctrine 2 DQL?

后端 未结 3 1045
既然无缘
既然无缘 2020-12-03 18:43

IN Symfony, when i used the following query with DATE function in the mysql i get a error

    SELECT employer.companyName AS employerName, jobs.jobId, jobs.         


        
3条回答
  •  情书的邮戳
    2020-12-03 19:18

    DQL is only aware of few standard sql functions (coalesce for example). To be able to use your custom function you need to register it and tell doctrine how to translate it into raw sql. Follow these guides:

    Symfony Doc

    Doctrine Doc

    And check my answer here

提交回复
热议问题