devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

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

Open ioweb-gr opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

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

ioweb-gr avatar Dec 18 '23 13:12 ioweb-gr

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.

m2-assistant[bot] avatar Dec 18 '23 13:12 m2-assistant[bot]