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.
Asked
Active
Viewed 165 times
1
-
Not mentioned in the doc ?? http://symfony.com/doc/current/cookbook/doctrine/custom_dql_functions.html – BENARD Patrick Apr 08 '16 at 19:54
-
You're right. Edited the question. I couldn't find it, because initally I was looking in doctrine's documentation, not symfony's. If you check the editions on this question you'll see that initially I asked about doctrine. Thanks. – Nelson Teixeira Apr 08 '16 at 19:57
-
You should update your answer and accept it for futur visitors. – BENARD Patrick Apr 08 '16 at 19:59
-
I made this question today. I only alllows this after 2 days. But about answer update, what should I update ? didn't get that part. – Nelson Teixeira Apr 08 '16 at 20:16
1 Answers
1
I've found it.
You can register it on config.yml
doctrine:
orm:
dql:
numeric_functions:
INT: YourProject\YourBundle\Folder\CastAsInteger
Nelson Teixeira
- 6,297
- 5
- 36
- 73