zendframework / zend-paginator

Paginate collections of data from arbitrary sources.
BSD 3-Clause "New" or "Revised" License
36 stars 30 forks source link

DbSelectFactory correctly injects custom count select into adapter #45

Closed Brindster closed 6 years ago

Brindster commented 6 years ago

Currently, the DbSelectFactory factory is unable to inject a count select into the constructor of the DbSelect class. This pull request fixes this issue.

froschdesign commented 6 years ago

@Brindster I like this improvement! 👍

Can you also update the documentation? At the moment the documentation includes an example for this scenario with an extension of the DbSelect class. With your improvement this is no longer needed. Can you replace the related text and code example with the usage of the factory?

Docs: https://docs.zendframework.com/zend-paginator/usage/#the-dbselect-adapter

That would be awesome!

weierophinney commented 6 years ago

Thanks, @Brindster; I have correctly identified this as a bugfix now, and scheduled it for a 2.8.1 release.

froschdesign commented 6 years ago

@weierophinney If this is a bug, then we must also fix the AdapterPluginManager and the factory for ArrayAdapter:

https://github.com/zendframework/zend-paginator/blob/b4e853ef104101069e781f50f662f514e4e4e33f/src/AdapterPluginManager.php#L65

The adapter includes never any items if it is retrieved by the manager.

weierophinney commented 6 years ago

@froschdesign Yes. Care to open some issues and mark them as help wanted?