paginate()
paginate(\Model|string $object = null, string|array $scope = array(), array $whitelist = array()) : array
Handles automatic pagination of model records.
Parameters
\Model|string | $object | Model to paginate (e.g: model instance, or 'Model', or 'Model.InnerModel') |
string|array | $scope | Additional find conditions to use while paginating |
array | $whitelist | List of allowed fields for ordering. This allows you to prevent ordering on non-indexed, or undesirable columns. See PaginatorComponent::validateSort() for additional details on how the whitelisting and sort field validation works. |
Throws
- \MissingModelException
- \NotFoundException
Returns
array —Model query results