someWork / offset-page-logic
将偏移量请求转换为页面请求的逻辑
1.0.7
2017-06-05 08:59 UTC
Requires
- php: >=5.5
Requires (Dev)
- phpunit/phpunit: ^4.8
This package is auto-updated.
Last update: 2024-08-29 04:31:23 UTC
README
作者:Igor Pinchuk
电子邮件:i.pinchuk.work@gmail.com
处理当您只有页面、页面大小源接口,并且需要偏移量限制接口时的问题的包
$offset = 0; $limit = 0; $nowCount = 0; $result = \SomeWork\OffsetPage\Logic\Offset::logic($offset, $limit, $nowCount); $result->getPage(); //0 $result->getSize(); //0
$offset = 0; $limit = 5; $nowCount = 5; $result = \SomeWork\OffsetPage\Logic\Offset::logic($offset, $limit, $nowCount); // Throw exception \SomeWork\OffsetPage\Logic\AlreadyGetNeededCountException
许可证
MIT