-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
[v3] Refactor: Cut Redundant Dependency in order to use as Standalone #5
Comments
@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. Originally posted by @marc-mabe at zendframework/zend-paginator#9 (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. Originally posted by @marc-mabe at zendframework/zend-paginator#9 (comment) |
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) Originally posted by @Ocramius at zendframework/zend-paginator#9 (comment) |
To be clear, talking cache problem is current v2 Paginator implemntaions ? Firstly, this PR only tried cutting Redundant Dependency for current implementaion. Originally posted by @sasezaki at zendframework/zend-paginator#9 (comment) |
@sasezaki @Ocramius I agree that the caching issue is not part of this PR but it should be addressed in another PR before v3. Originally posted by @marc-mabe at zendframework/zend-paginator#9 (comment) |
@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! Originally posted by @weierophinney at zendframework/zend-paginator#9 (comment) |
FilterTrait, CachedTraitI think class CacheWrapperAdapter implements AdapterInterface {
public function __construct(AdapterInterface $adapter, CacheInterface $cache)
{ }
}
new Paginator(new CacheWrapperAdapter(new DbSelectAdapter(), $cache)); class FilterWrapperAdapter implements AdapterInterface {
public function __construct(AdapterInterface $adapter, FilterInterface $filter)
{ }
}
new Paginator(new FilterWrapperAdapter(new DbSelectAdapter(), $filter)); JsonSerializeTrait &
|
The original pull request contains some good points, but the implementation is wrong and cannot be followed up:
A new major version that breaks backwards compatibility should offer more improvements for the user, the code and component itself. However, we will continue to use the suggestions of the pull request to create a RFC for the new major version. Thank you for this contribution! |
"Wrapper" is nameless and without any technical meaning, therefore it should be avoid. |
@sasezaki https://docs.laminas.dev/laminas-paginator/application-integration/stand-alone/ |
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);
Originally posted by @sasezaki at zendframework/zend-paginator#9
The text was updated successfully, but these errors were encountered: