Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 516 Bytes

The-Pagination-Service.md

File metadata and controls

23 lines (18 loc) · 516 Bytes

The Pagination Service

Exmaple

use Phauthentic\Pagination\PaginationService;
use Phauthentic\Pagination\Paginator\ArrayPaginator;

// Do this or use your favorite DI container to build the service
$service = new PaginationService(
    new PaginationParamsFactory(),
    new ArrayPaginator()
);

$array = [
	['username' => 'steven_hawking'],
	['username' => 'leung_ting'],
	// And more...
]

// Calls getPagingParams() internally and passes it to the mapper
$resultSet = $service->paginate($array);