Search code examples
symfonydoctrinedql

In Symfony where do I register a custom DQL function?


I have read here how to do a custom DQL function. But in what file do I put the register function part ? I couldn't find this in the documentation.


Solution

  • I've found it.

    You can register it on config.yml

    doctrine:
        orm:
            dql:
                numeric_functions:
                    INT: YourProject\YourBundle\Folder\CastAsInteger