Skip to content
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

Searching #60

Open
michalbundyra opened this issue Jan 10, 2020 · 3 comments
Open

Searching #60

michalbundyra opened this issue Jan 10, 2020 · 3 comments

Comments

@michalbundyra
Copy link
Member

Hello, it's possible to search using apiglity ? Using query string params ? For example, search user list by name, birthday, etc ? Automatic search


Originally posted by @luqezman at zfcampus/zf-apigility#77

@michalbundyra
Copy link
Member Author

Hi joaolucas89,

the zf-apigility-doctrine module contains filters like you describe. Read the documentation here for details: https://github.com/zfcampus/zf-apigility-doctrine

The filters are a good idea in theory but in practice it's not as beneficial. For instance, you don't want to allow your users to query on just anything. So, I'm pulling them into their own repository so you can apply the filters to any Query Builder object.

Stay tuned and/or come contribute,
Tom


Originally posted by @TomHAnderson at zfcampus/zf-apigility#77 (comment)

@michalbundyra
Copy link
Member Author

zf-apigility-doctrine provide collection attributes like total, page_count, limit ?


Originally posted by @luqezman at zfcampus/zf-apigility#77 (comment)

@michalbundyra
Copy link
Member Author

If your collection is a Zend\Paginator\Paginator instance you will have full pagination options. You can read on this here in the documentationof the zf-rest module.

If you make your collection to an instance of Countable then the Hal plugin will automatically count your total items and add a total_items key in the rendered result. This happens because the Hal plugin is checking this while rendering the collection.


Originally posted by @Wilt at zfcampus/zf-apigility#77 (comment)

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

No branches or pull requests

1 participant