Bitrix API

ReversePageNavigation extends PageNavigation

Class PageNavigation

This class helps to calculate limits for DB queries and other data sources to organize page navigation through results.

Examples of supported URLs: /page.php?nav-cars=page-5&nav-books=page-2&other=params /page.php?nav-cars=page-5-size-20&nav-books=page-2 /page.php?nav-cars=page-all&nav-books=page-2 /page/nav-cars/page-2/size-20/something/ /page/nav-cars/page-all/something/?other=params /page/nav-cars/page-5/nav-books/page-2/size-10

Table of Contents

Methods

__construct()  : mixed
addParams()  : Uri
Returns an URI with navigation parameters compatible with initFromUri().
allowAllRecords()  : $this
allRecordsAllowed()  : bool
Returns true if showing all records is allowed.
allRecordsShown()  : bool
Returns true if all the records are shown in one page.
clearParams()  : Uri
Clears an URI from navigation parameters and returns it.
getCurrentPage()  : int
Returns the current page number.
getId()  : string
Returns navigation ID.
getLimit()  : int
Returns the number of records in the current page.
getOffset()  : int
Returns offset of the first record of the current page.
getPageCount()  : int
Returns number of pages.
getPageSize()  : int
Returns "formal" page size.
getPageSizes()  : array<string|int, mixed>
Returns allowed page sizes.
getRecordCount()  : int|null
Returns number of records.
initFromUri()  : void
Initializes the navigation from URI.
setCurrentPage()  : $this
setPageSize()  : $this
setPageSizes()  : $this
This controls which sizes are available via user interface.
setRecordCount()  : $this

Methods

__construct()

public __construct(string $id, int $count) : mixed
Parameters
$id : string

Navigation identity like "nav-cars".

$count : int

Record count.

addParams()

Returns an URI with navigation parameters compatible with initFromUri().

public addParams(Uri $uri, bool $sef, string $page[, string $size = null ]) : Uri
Parameters
$uri : Uri
$sef : bool

SEF mode.

$page : string

Page number.

$size : string = null

Page size.

Return values
Uri

allowAllRecords()

public allowAllRecords(bool $mode) : $this
Parameters
$mode : bool

Allows to show all records, yes or no.

Return values
$this

allRecordsAllowed()

Returns true if showing all records is allowed.

public allRecordsAllowed() : bool
Return values
bool

allRecordsShown()

Returns true if all the records are shown in one page.

public allRecordsShown() : bool
Return values
bool

clearParams()

Clears an URI from navigation parameters and returns it.

public clearParams(Uri $uri, bool $sef) : Uri
Parameters
$uri : Uri
$sef : bool

SEF mode.

Return values
Uri

getCurrentPage()

Returns the current page number.

public getCurrentPage() : int
Return values
int

getId()

Returns navigation ID.

public getId() : string
Return values
string

getLimit()

Returns the number of records in the current page.

public getLimit() : int
Return values
int

getOffset()

Returns offset of the first record of the current page.

public getOffset() : int
Return values
int

getPageSize()

Returns "formal" page size.

public getPageSize() : int
Return values
int

getPageSizes()

Returns allowed page sizes.

public getPageSizes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRecordCount()

Returns number of records.

public getRecordCount() : int|null
Return values
int|null

initFromUri()

Initializes the navigation from URI.

public initFromUri() : void

setCurrentPage()

public setCurrentPage(int $n) : $this
Parameters
$n : int

The current page number.

Return values
$this

setPageSize()

public setPageSize(int $n) : $this
Parameters
$n : int

Page size.

Return values
$this

setPageSizes()

This controls which sizes are available via user interface.

public setPageSizes(array<string|int, mixed> $sizes) : $this
Parameters
$sizes : array<string|int, mixed>

Array of integers.

Return values
$this

setRecordCount()

public setRecordCount(int $n) : $this
Parameters
$n : int

Number of records (to calculate number of pages).

Return values
$this

        
On this page

Search results