Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e222c57

Browse files
committed
minor #6961 [Doctrine] Exception note about functions with named managers (rvanlaak)
This PR was merged into the 2.7 branch. Discussion ---------- [Doctrine] Exception note about functions with named managers In case the managers were defined/named explicitly, the DQL functions should also be defined over there. Commits ------- 075f56c [Doctrine] Exception note about functions with named managers
2 parents 6d44ed8 + 075f56c commit e222c57

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

doctrine/custom_dql_functions.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,23 @@ In Symfony, you can register your custom DQL functions as follows:
6969
),
7070
));
7171
72+
.. note::
73+
74+
In case the ``entity_managers`` were named explicitly, configuring the functions with the
75+
orm directly will trigger the exception `Unrecognized option "dql" under "doctrine.orm"`.
76+
The `dql` configuration block must be defined under the named entity manager.
77+
78+
.. code-block:: yaml
79+
80+
# app/config/config.yml
81+
doctrine:
82+
orm:
83+
# ...
84+
entity_managers:
85+
example_manager:
86+
# Place your functions here
87+
dql:
88+
datetime_functions:
89+
test_datetime: AppBundle\DQL\DatetimeFunction
90+
7291
.. _`DQL User Defined Functions`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html

0 commit comments

Comments
 (0)