File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -411,3 +411,42 @@ Each connection is also accessible via the ``doctrine.dbal.[name]_connection``
411
411
service where ``[name] `` is the name of the connection.
412
412
413
413
.. _DBAL documentation : http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html
414
+
415
+ Register Custom DQL Functions
416
+ -----------------------------
417
+
418
+ Doctrine allows you to specify custom DQL functions. For more information
419
+ on this topic, read Doctrine's cookbook article "`DQL User Defined Functions `_".
420
+
421
+ In Symfony, you can register your custom DQL functions as follows:
422
+
423
+ .. code-block :: yaml
424
+ doctrine :
425
+ orm :
426
+ # ...
427
+ entity_managers :
428
+ default :
429
+ # ...
430
+ dql :
431
+ string_functions :
432
+ test_string : Acme\HelloBundle\DQL\StringFunction
433
+ second_string : Acme\HelloBundle\DQL\SecondStringFunction
434
+ numeric_functions :
435
+ test_numeric : Acme\HelloBundle\DQL\NumericFunction
436
+ datetime_functions :
437
+ test_datetime : Acme\HelloBundle\DQL\DatetimeFunction
438
+
439
+ However, if you are only using one entity manager, DQL functions can be registed like this:
440
+
441
+ .. code-block :: yaml
442
+ doctrine :
443
+ orm :
444
+ # ...
445
+ dql :
446
+ string_functions :
447
+ test_string : Acme\HelloBundle\DQL\StringFunction
448
+ second_string : Acme\HelloBundle\DQL\SecondStringFunction
449
+ numeric_functions :
450
+ test_numeric : Acme\HelloBundle\DQL\NumericFunction
451
+ datetime_functions :
452
+ test_datetime : Acme\HelloBundle\DQL\DatetimeFunction
You can’t perform that action at this time.
0 commit comments