Skip to content

Doctrine ORM Filters - service declaration #440

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

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

BatsaxIV
Copy link
Contributor

Hi,

This is a proposal to clarify a point with the service declaration and the _defaults section, which may not make perfect sense for newcomers.

core/filters.md Outdated
@@ -30,12 +30,28 @@ services:
arguments: [ { dateProperty: ~ } ]
tags: [ 'api_platform.filter' ]
# The following are mandatory only if a _defaults section is defined
# You may want to isolate filters in a dedicated file to avoid adding them
Copy link
Member

@dunglas dunglas Mar 19, 2018

Choose a reason for hiding this comment

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

Ok for the see, but I'll keep the comment about a dedicated file (it's a a good practice in large apps)

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've added that point just after with a dedicated example (l.39), but maybe this is too much information? If not, we may add the comment that it's a good practice in large apps.

core/filters.md Outdated
services:
_defaults:
autowire: false
autoconfigure: false
Copy link
Contributor

Choose a reason for hiding this comment

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

With autoconfigure true you could remove the tag in the declaration isn't it ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As it was specified in the doc to "false" and I'm not familiar enough with apiplatform, i've let the default parameter. What does the apiplatform team think?

Copy link
Member

Choose a reason for hiding this comment

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

This is the default in a new file, so you can just remove the whole _defaults block here.

core/filters.md Outdated
services:
_defaults:
autowire: false
autoconfigure: false
Copy link
Member

Choose a reason for hiding this comment

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

This is the default in a new file, so you can just remove the whole _defaults block here.

@alanpoulain alanpoulain merged commit 4e126dc into api-platform:main Sep 13, 2022
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.

4 participants