somework/offset-page-logic

Logic to convert offset request to page request

Installs: 5 126

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0

pkg:composer/somework/offset-page-logic

1.0.7 2017-06-05 08:59 UTC

This package is auto-updated.

Last update: 2025-09-29 02:01:57 UTC


README

Author: Igor Pinchuk
Email: i.pinchuk.work@gmail.com

Travis build Scrutinizer Code Quality SensioLabsInsight StyleCI

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