somework / offset-page-logic
Logic to convert offset request to page request
Installs: 3 426
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.5
Requires (Dev)
- phpunit/phpunit: ^4.8
This package is auto-updated.
Last update: 2024-10-29 04:58:55 UTC
README
Author: Igor Pinchuk
Email: i.pinchuk.work@gmail.com
Package that handle problem when you have only page, pagesize source interface and you need offset limit interface
$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
License
MIT