How can I order by NULL in DQL?

后端 未结 6 765
野趣味
野趣味 2021-01-02 20:18

I\'m building an app using Symfony2 framework and using Doctrine ORM. I have a table with airlines for which some IATA codes are missing. I\'m outputting a list, ordered by

6条回答
  •  情书的邮戳
    2021-01-02 20:41

    DQL does not contain every function of plain SQL. Fortunately you can define your custom DQL method to accomplish this.

    Some resources:

    http://punkave.com/window/2012/07/24/for-the-php-crowd-adding-custom-functions-to-doctrine-2-dql

    http://docs.doctrine-project.org/en/2.1/cookbook/dql-user-defined-functions.html

    http://symfony.com/doc/2.0/cookbook/doctrine/custom_dql_functions.html

提交回复
热议问题