Skip to content
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

Closed
wants to merge 11 commits into from
34 changes: 34 additions & 0 deletions reference/configuration/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,37 @@ 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

Choose a reason for hiding this comment

The 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:
# ...
metadata_cache_driver:
# ...
result_cache_driver:
# ...
connection: ~
class_metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory
default_repository_class: Doctrine\ORM\EntityRepository
auto_mapping: false
hydrators:
# ...
mappings:
# ...
dql:
# ...
filters:
# ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a configuration block providing all the different available formats would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure about showing other formats too:

  • Yaml is more readable and shows what has to be done quite well.
  • PHP isn't even shown on this same page
  • XML could be done, yes.

Anyway I'll work on that a bit later and I'll propose your recommendation too. Thanks!


This shorten version is commonly used in other documentation sections. Keep in mind that you can't use both syntax at same time.
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The 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