-
Notifications
You must be signed in to change notification settings - Fork 30
[v3] Refactor: Cut Redundant Dependency in order to use as Standalone #9
base: develop
Are you sure you want to change the base?
Conversation
todo getItemsByPage() must override by caching
Introduced SimplePaginator, too. Cache & Filter is required getItemsByPage
getItemCountPerPage() works with static::getDefaultItemCountPerPage(), lazy count-per-page check
Stdlib only require ArrayUtils::iteratorToArray() method. It used in GlobalPaginator::setGlobalConfig.
fix invalid lines, remove useless `use`
@sasezaki the caching should also be moved into the adapters because the adapter only know how to cache paginater results. I think the issues for that are in the zf2 repo. |
1 similar comment
@sasezaki the caching should also be moved into the adapters because the adapter only know how to cache paginater results. I think the issues for that are in the zf2 repo. |
Caching could still exist, but on a separate instance. Agreed tho: it needs to die for now (the current approach is using static caching, that can lead to horrible SNAFU moments) |
To be clear, talking cache problem is current v2 Paginator implemntaions ? Firstly, this PR only tried cutting Redundant Dependency for current implementaion. |
Don't add new method when Refactoring. (oops, jsonSerialize() introduced with my misunderstood usage.)
@sasezaki Could you provide some usage examples? These will be important for understanding the impact to end users, and will also shed more light on the design changes. Thanks! |
protected function _getCacheInternalId() | ||
{ | ||
return md5(serialize([ | ||
spl_object_hash($this->getAdapter()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this cache internal id fixed by #33 , this may need copy function from current master branch.
This repository has been closed and moved to laminas/laminas-paginator; a new issue has been opened at laminas/laminas-paginator#5. |
This repository has been moved to laminas/laminas-paginator. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:
|
Refactor: Cut Redundant Dependency in order to use as Standalone.
When using Paginator class as Dependency, there is problem.
$paginator->getPages(new Zend\Paginator\ScrollingStyle\All()))
Above thing is a headache when to use standalone.
So I request refactoring this component.
Introduced below interface, trait, class.
.. And Paginator class can implements like below, without BC break.
Only ScrollingStyleInterface implentation must be changed.
BEFORE
public function getPages(Paginator $paginator, $pageRange = null);
AFTER
public function getPages(PaginatorInterface $paginator, $pageRange = null);