# \CGExtensions\querypagination

A class to assist in building a paginator navigation for the results of a query.

## Summary

Methods
Properties
Constants
__construct()
get_pagelist()
get_pagehash()
$pagecount
$page
$
$
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  lib/query/class.pagination.php
Class hierarchy
  \CGExtensions\query\pagination

## Tags

todo |

## Properties

### $pagecount

    $pagecount : int

The number of pages

#### Type

int

#

## Tags

None found

### $page

    $page : int

The current page number (one based)

#### Type

int

#

## Tags

None found

### $

    $ : int

pagelimit The page limit from the query object

#### Type

int

#

## Tags

None found

### $

    $ : int

totalroas The total matching rows for the resultset (independent of limit or offset)

#### Type

int

#

## Tags

None found

## Methods

### __construct()

    __construct(\CGExtensions\query\resultset $rs)

The constructor

#### Parameters

\CGExtensions\query\resultset | $rs | A resultset object )

#

See also

## Tags

todo |

### get_pagelist()

    get_pagelist(int $surround) : int[]

Get a list of page numbers suitable for using in a loop to build a navigation list.

This method will use optimization to ensure that the number of items returned in the list will never grow too large

#### Parameters

int | $surround | The number of page numbers to surround the current page with.

#### Returns

int[]

#

## Tags

todo |

### get_pagehash()

    get_pagehash(int $surround) : array

Get a hash of page numbers suitable for using in a loop to build a navigation list.

#### Parameters

int | $surround | The number of pages around the current page (and the beginning and end) to return.

#### Returns

array

#

See also

## Tags

todo |

### class.pagination.php