diff --git a/cookbook/doctrine/custom_dql_functions.rst b/cookbook/doctrine/custom_dql_functions.rst index 35141309b5e..25b2dd2ceca 100644 --- a/cookbook/doctrine/custom_dql_functions.rst +++ b/cookbook/doctrine/custom_dql_functions.rst @@ -17,14 +17,17 @@ In Symfony, you can register your custom DQL functions as follows: doctrine: orm: # ... - dql: - string_functions: - test_string: Acme\HelloBundle\DQL\StringFunction - second_string: Acme\HelloBundle\DQL\SecondStringFunction - numeric_functions: - test_numeric: Acme\HelloBundle\DQL\NumericFunction - datetime_functions: - test_datetime: Acme\HelloBundle\DQL\DatetimeFunction + entity_managers: + default: + # ... + dql: + string_functions: + test_string: Acme\HelloBundle\DQL\StringFunction + second_string: Acme\HelloBundle\DQL\SecondStringFunction + numeric_functions: + test_numeric: Acme\HelloBundle\DQL\NumericFunction + datetime_functions: + test_datetime: Acme\HelloBundle\DQL\DatetimeFunction .. code-block:: xml @@ -38,12 +41,15 @@ In Symfony, you can register your custom DQL functions as follows: - - Acme\HelloBundle\DQL\SecondStringFunction - Acme\HelloBundle\DQL\DatetimeFunction - + + + + Acme\HelloBundle\DQL\SecondStringFunction + Acme\HelloBundle\DQL\DatetimeFunction + + @@ -54,16 +60,21 @@ In Symfony, you can register your custom DQL functions as follows: $container->loadFromExtension('doctrine', array( 'orm' => array( // ... - 'dql' => array( - 'string_functions' => array( - 'test_string' => 'Acme\HelloBundle\DQL\StringFunction', - 'second_string' => 'Acme\HelloBundle\DQL\SecondStringFunction', - ), - 'numeric_functions' => array( - 'test_numeric' => 'Acme\HelloBundle\DQL\NumericFunction', - ), - 'datetime_functions' => array( - 'test_datetime' => 'Acme\HelloBundle\DQL\DatetimeFunction', + 'entity_managers' => array( + 'default' => array( + // ... + 'dql' => array( + 'string_functions' => array( + 'test_string' => 'Acme\HelloBundle\DQL\StringFunction', + 'second_string' => 'Acme\HelloBundle\DQL\SecondStringFunction', + ), + 'numeric_functions' => array( + 'test_numeric' => 'Acme\HelloBundle\DQL\NumericFunction', + ), + 'datetime_functions' => array( + 'test_datetime' => 'Acme\HelloBundle\DQL\DatetimeFunction', + ), + ), ), ), ),