@@ -412,46 +412,72 @@ 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
414
415
- Register Custom DQL Functions
415
+ Shorten configuration syntax
416
416
-----------------------------
417
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
-
425
- doctrine :
426
- orm :
427
- # ...
428
- entity_managers :
429
- default :
430
- # ...
431
- dql :
432
- string_functions :
433
- test_string : Acme\HelloBundle\DQL\StringFunction
434
- second_string : Acme\HelloBundle\DQL\SecondStringFunction
435
- numeric_functions :
436
- test_numeric : Acme\HelloBundle\DQL\NumericFunction
437
- datetime_functions :
438
- test_datetime : Acme\HelloBundle\DQL\DatetimeFunction
439
-
440
- However, if you are only using one entity manager, DQL functions can be registed like this:
418
+ When you are only using one entity manager, all config options available
419
+ for each entity manager can be placed directly under doctrine.orm config level.
441
420
442
421
.. code-block :: yaml
443
422
444
423
doctrine :
445
424
orm :
446
425
# ...
426
+ query_cache_driver :
427
+ type : array # Required
428
+ host : ~
429
+ port : ~
430
+ instance_class : ~
431
+ class : ~
432
+ metadata_cache_driver :
433
+ type : array # Required
434
+ host : ~
435
+ port : ~
436
+ instance_class : ~
437
+ class : ~
438
+ result_cache_driver :
439
+ type : array # Required
440
+ host : ~
441
+ port : ~
442
+ instance_class : ~
443
+ class : ~
444
+ connection : ~
445
+ class_metadata_factory_name : Doctrine\ORM\Mapping\ClassMetadataFactory
446
+ default_repository_class : Doctrine\ORM\EntityRepository
447
+ auto_mapping : false
448
+ hydrators :
449
+ # An array of hydrator names
450
+ hydrator_name : []
451
+ mappings :
452
+ # An array of mappings, which may be a bundle name or something else
453
+ mapping_name :
454
+ mapping : true
455
+ type : ~
456
+ dir : ~
457
+ alias : ~
458
+ prefix : ~
459
+ is_bundle : ~
447
460
dql :
461
+ # a collection of string functions
448
462
string_functions :
449
- test_string : Acme\HelloBundle\DQL\StringFunction
450
- second_string : Acme\HelloBundle\DQL\SecondStringFunction
463
+ # example
464
+ # test_string: Acme\HelloBundle\DQL\StringFunction
465
+
466
+ # a collection of numeric functions
451
467
numeric_functions :
452
- test_numeric : Acme\HelloBundle\DQL\NumericFunction
453
- datetime_functions :
454
- test_datetime : Acme\HelloBundle\DQL\DatetimeFunction
468
+ # example
469
+ # test_numeric: Acme\HelloBundle\DQL\NumericFunction
455
470
471
+ # a collection of datetime functions
472
+ datetime_functions :
473
+ # example
474
+ # test_datetime: Acme\HelloBundle\DQL\DatetimeFunction
475
+ filters :
476
+ # An array of filters
477
+ some_filter :
478
+ class : ~ # Required
479
+ enabled : false
480
+
481
+ This shorten version is commonly used in other documentation sections. Keep in mind that you can't use both syntax at same time.
456
482
457
483
.. _`DQL User Defined Functions` : http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html
0 commit comments