Skip to content

Correct How to register custom DQL Functions #3939

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

Closed
wants to merge 1 commit into from

Conversation

healdropper
Copy link
Contributor

For all symfony versions, official documentation suggests that custom dql functions should be declared in config.yml under doctrine.orm, but that's not correct.

http://symfony.com/doc/2.4/cookbook/doctrine/custom_dql_functions.html

Actually, It works If your custom functions are declared inside every entity manager that uses them, i.e, doctrine.orm.entity_managers.default

For all symfony versions, official documentation suggests that custom dql functions should be declared in config.yml under doctrine.orm, but that's not correct.

Actually, It works If your custom functions are declared inside every entity manager that uses them, i.e, doctrine.orm.entity_managers.default
@wouterj
Copy link
Member

wouterj commented Jun 12, 2014

If you only have one entity manager, you can configure it just under doctrine.orm.

@weaverryan it seems like people are getting confused with this. We really need to improve Doctrine code :)

@healdropper
Copy link
Contributor Author

Oh I see.

Many people read this reference http://symfony.com/doc/current/reference/configuration/doctrine.html when looking for available config parameters and that's how I figured out how to solve it.

Is there a mention about it somewhere in symfony.com? It should be mentioned in both reference and custom dql pages

Thanks!

@wouterj
Copy link
Member

wouterj commented Jun 12, 2014

Is there a mention about it somewhere in symfony.com? It should be mentioned in both reference and custom dql pages

It should be documented in the reference indeed. Can you take care of that? Otherwise, can you please create an issue so we won't forget it?
It shouldn't be documented in the custom dql article imo. If we do that, we should put it next to all examples of doctrine entity manager related code and that's not very nice...

@healdropper
Copy link
Contributor Author

Sure, I'll take care of it later.

@wouterj
Copy link
Member

wouterj commented Jun 12, 2014

Great!

weaverryan added a commit that referenced this pull request Jul 2, 2014
…opper)

This PR was submitted for the 2.5 branch but it was merged into the 2.3 branch instead (closes #3946).

Discussion
----------

DQL custom functions on doctrine reference page

Custom DQL functions can be configured in two ways, according to what I was told [ here ] (#3939)

It should be clearified in doctrine reference page because It may confuse some people that just read the cookbook  section about [custom DQL functions] (http://symfony.com/doc/current/cookbook/doctrine/custom_dql_functions.html)

Commits
-------

39957c5 Update doctrine.rst
b4f3151 Update doctrine.rst
9536c17 Update doctrine.rst
044e1eb Update doctrine.rst
1ce3fcc Update doctrine.rst
4a046fa Update doctrine.rst
69efced Shorten syntax mention on doctrine reference
98dee12 Fixed broked link
95f53ae Update doctrine.rst
b5f9ac0 Update doctrine.rst
2541f86 DQL custom functions on doctrine reference page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants