Skip to content

Commit fd4f4f2

Browse files
author
FlorianLB
committed
switch custom DQL code example from multi-manager to single (PHP and XML)
1 parent 886ccd5 commit fd4f4f2

File tree

1 file changed

+16
-26
lines changed

1 file changed

+16
-26
lines changed

cookbook/doctrine/custom_dql_functions.rst

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,12 @@ In Symfony, you can register your custom DQL functions as follows:
3838
<doctrine:config>
3939
<doctrine:orm>
4040
<!-- ... -->
41-
<doctrine:entity-manager name="default">
42-
<!-- ... -->
43-
<doctrine:dql>
44-
<doctrine:string-function name="test_string>Acme\HelloBundle\DQL\StringFunction</doctrine:string-function>
45-
<doctrine:string-function name="second_string>Acme\HelloBundle\DQL\SecondStringFunction</doctrine:string-function>
46-
<doctrine:numeric-function name="test_numeric>Acme\HelloBundle\DQL\NumericFunction</doctrine:numeric-function>
47-
<doctrine:datetime-function name="test_datetime>Acme\HelloBundle\DQL\DatetimeFunction</doctrine:datetime-function>
48-
</doctrine:dql>
49-
</doctrine:entity-manager>
41+
<doctrine:dql>
42+
<doctrine:string-function name="test_string>Acme\HelloBundle\DQL\StringFunction</doctrine:string-function>
43+
<doctrine:string-function name="second_string>Acme\HelloBundle\DQL\SecondStringFunction</doctrine:string-function>
44+
<doctrine:numeric-function name="test_numeric>Acme\HelloBundle\DQL\NumericFunction</doctrine:numeric-function>
45+
<doctrine:datetime-function name="test_datetime>Acme\HelloBundle\DQL\DatetimeFunction</doctrine:datetime-function>
46+
</doctrine:dql>
5047
</doctrine:orm>
5148
</doctrine:config>
5249
</container>
@@ -57,23 +54,16 @@ In Symfony, you can register your custom DQL functions as follows:
5754
$container->loadFromExtension('doctrine', array(
5855
'orm' => array(
5956
// ...
60-
61-
'entity_managers' => array(
62-
'default' => array(
63-
// ...
64-
65-
'dql' => array(
66-
'string_functions' => array(
67-
'test_string' => 'Acme\HelloBundle\DQL\StringFunction',
68-
'second_string' => 'Acme\HelloBundle\DQL\SecondStringFunction',
69-
),
70-
'numeric_functions' => array(
71-
'test_numeric' => 'Acme\HelloBundle\DQL\NumericFunction',
72-
),
73-
'datetime_functions' => array(
74-
'test_datetime' => 'Acme\HelloBundle\DQL\DatetimeFunction',
75-
),
76-
),
57+
'dql' => array(
58+
'string_functions' => array(
59+
'test_string' => 'Acme\HelloBundle\DQL\StringFunction',
60+
'second_string' => 'Acme\HelloBundle\DQL\SecondStringFunction',
61+
),
62+
'numeric_functions' => array(
63+
'test_numeric' => 'Acme\HelloBundle\DQL\NumericFunction',
64+
),
65+
'datetime_functions' => array(
66+
'test_datetime' => 'Acme\HelloBundle\DQL\DatetimeFunction',
7767
),
7868
),
7969
),

0 commit comments

Comments
 (0)