-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DQL custom functions on doctrine reference page #3946
Changes from 5 commits
2541f86
b5f9ac0
95f53ae
98dee12
69efced
4a046fa
1ce3fcc
044e1eb
9536c17
b4f3151
39957c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -411,3 +411,73 @@ Each connection is also accessible via the ``doctrine.dbal.[name]_connection`` | |
service where ``[name]`` is the name of the connection. | ||
|
||
.. _DBAL documentation: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html | ||
|
||
Shorten configuration syntax | ||
----------------------------- | ||
|
||
When you are only using one entity manager, all config options available | ||
for each entity manager can be placed directly under doctrine.orm config level. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put doctrine.orm in literals (double backticks). |
||
|
||
.. code-block:: yaml | ||
|
||
doctrine: | ||
orm: | ||
# ... | ||
query_cache_driver: | ||
type: array # Required | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think - to avoid duplication (but to keep things clear) we should only show the top-level items (e.g. query_cache_driver:
# ...
metadata_cache_driver:
# ...
result_cache_driver:
# ...
connection: ~
class_metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory and then continued for everything else. What do you think about that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably it will be easier to understand, yes. The shorter, the better in this case. |
||
host: ~ | ||
port: ~ | ||
instance_class: ~ | ||
class: ~ | ||
metadata_cache_driver: | ||
type: array # Required | ||
host: ~ | ||
port: ~ | ||
instance_class: ~ | ||
class: ~ | ||
result_cache_driver: | ||
type: array # Required | ||
host: ~ | ||
port: ~ | ||
instance_class: ~ | ||
class: ~ | ||
connection: ~ | ||
class_metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory | ||
default_repository_class: Doctrine\ORM\EntityRepository | ||
auto_mapping: false | ||
hydrators: | ||
# An array of hydrator names | ||
hydrator_name: [] | ||
mappings: | ||
# An array of mappings, which may be a bundle name or something else | ||
mapping_name: | ||
mapping: true | ||
type: ~ | ||
dir: ~ | ||
alias: ~ | ||
prefix: ~ | ||
is_bundle: ~ | ||
dql: | ||
# a collection of string functions | ||
string_functions: | ||
# example | ||
# test_string: Acme\HelloBundle\DQL\StringFunction | ||
|
||
# a collection of numeric functions | ||
numeric_functions: | ||
# example | ||
# test_numeric: Acme\HelloBundle\DQL\NumericFunction | ||
|
||
# a collection of datetime functions | ||
datetime_functions: | ||
# example | ||
# test_datetime: Acme\HelloBundle\DQL\DatetimeFunction | ||
filters: | ||
# An array of filters | ||
some_filter: | ||
class: ~ # Required | ||
enabled: false | ||
|
||
This shorten version is commonly used in other documentation sections. Keep in mind that you can't use both syntax at same time. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please split the line after the first word that crosses the 72nd character. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [...] at the same time. |
||
|
||
.. _`DQL User Defined Functions`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shorten Configuration Syntax