magento / devdocs

Magento Developer Documentation
https://devdocs.magento.com
Open Software License 3.0
673 stars 1.77k forks source link

FilterProcessor documentation is very specific and doesn't explain how it works generally #9558

Open ioweb-gr opened 7 months ago

ioweb-gr commented 7 months ago

Is there an existing issue for this?

Which topic?

https://developer.adobe.com/commerce/php/development/components/searching-with-repositories/#filter-processor

What's wrong with the content?

I think that the example is severely lacking. From what I gather from the full code it needs additional steps

  1. Find the repository you're interested in
  2. Inject a virtualType collection processor based on the original collection processor
  3. In the processors arguments which is an array you need to inject a new FilterProcessor

This is not clear from the example

What changes do you propose?

There should be a full example, not partial fragments and for something that uses generic classes not specific ones.

For example OrderRepository uses the generic Magento\Framework\Api\SearchCriteria\CollectionProcessor

Overriding this to use it in the OrderRepository on multiple modules is bound to cause incompatibilities as each module will be overriding the CollectionProcessor of the OrderRepository with it's own

The example should take compatibility into account

Anything else that can help to cover this?

No response

m2-assistant[bot] commented 7 months ago

Hi @ioweb-gr. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information. Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.