-
Notifications
You must be signed in to change notification settings - Fork 60
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
Bug/inconvenience when baking FilterCollections #315
Comments
Versions: "cakephp/cakephp": "^4.3", (4.3.5) |
The "Filter" in the class name when they are already under the "Filter" folder/namespace does feel unnecessary. |
It comes from here: The Behavior on line 65 ff. looks for a Class name {Alias}Collection though: So it cannot work, I guess. But it might be a deliberate decision where I just did not find the reason. Both files were changed more than a year ago, so I cannot be the first person to notice that. :D |
Having "FooCollection" all over the code makes it harder to clarify what those are needed for, or harder to search. But yeah, for now we just need to fix it then to match what is expected
I use it successfully in all my projects the "right way"... |
I you bake a FilterCollection through the CLI, e.g.:
bin/cake bake filter_collection Users
this file will be created:
class UsersFilterCollection extends FilterCollection
However, this does not seem to work. It must be
UsersCollection
instead.I had quite a hard time finding out why it did not work, until I read the Docs very precisely, where there is a
PostsCollection
and not aPostsFilterCollection
:https://github.com/FriendsOfCake/search/tree/master/docs#filter-collection-classes
It would be great, if the Behavior would accept both versions, or if the bake command would create a Filter with proper naming.
The text was updated successfully, but these errors were encountered: