PHP Class Adldap\Objects\Paginator

Inheritance: implements Countabl\Countable, implements IteratorAggregat\IteratorAggregate
Mostrar archivo Open project: adldap2/adldap2 Class Usage Examples

Protected Properties

Property Type Description
$currentOffset integer The current entry offset number.
$currentPage integer The current page number.
$pages integer The total amount of pages.
$perPage integer The amount of entries per page.
$results array The complete results array.

Public Methods

Method Description
__construct ( array $results = [], integer $perPage = 50, integer $currentPage, integer $pages ) Constructor.
count ( ) : integer Returns the total amount of results.
getCurrentOffset ( ) : integer Returns the current offset number.
getCurrentPage ( ) : integer Returns the current page number.
getIterator ( ) : ArrayIterator Get an iterator for the entries.
getPages ( ) : integer Returns the total amount of pages in a paginated result.
getPerPage ( ) : integer Returns the total amount of entries allowed per page.
getResults ( ) : array Returns the complete results array.

Protected Methods

Method Description
setCurrentOffset ( integer $offset ) : Paginator Sets the current offset number.
setCurrentPage ( integer $currentPage ) : Paginator Sets the current page number.
setPages ( integer $pages ) : Paginator Sets the total number of pages.
setPerPage ( integer $perPage = 50 ) : Paginator Sets the number of entries per page.
setResults ( array $results ) : Paginator Sets the results array property.

Method Details

__construct() public method

Constructor.
public __construct ( array $results = [], integer $perPage = 50, integer $currentPage, integer $pages )
$results array
$perPage integer
$currentPage integer
$pages integer

count() public method

Returns the total amount of results.
public count ( ) : integer
return integer

getCurrentOffset() public method

Returns the current offset number.
public getCurrentOffset ( ) : integer
return integer

getCurrentPage() public method

Returns the current page number.
public getCurrentPage ( ) : integer
return integer

getIterator() public method

Get an iterator for the entries.

getPages() public method

Returns the total amount of pages in a paginated result.
public getPages ( ) : integer
return integer

getPerPage() public method

Returns the total amount of entries allowed per page.
public getPerPage ( ) : integer
return integer

getResults() public method

Returns the complete results array.
public getResults ( ) : array
return array

setCurrentOffset() protected method

Sets the current offset number.
protected setCurrentOffset ( integer $offset ) : Paginator
$offset integer
return Paginator

setCurrentPage() protected method

Sets the current page number.
protected setCurrentPage ( integer $currentPage ) : Paginator
$currentPage integer
return Paginator

setPages() protected method

Sets the total number of pages.
protected setPages ( integer $pages ) : Paginator
$pages integer
return Paginator

setPerPage() protected method

Sets the number of entries per page.
protected setPerPage ( integer $perPage = 50 ) : Paginator
$perPage integer
return Paginator

setResults() protected method

Sets the results array property.
protected setResults ( array $results ) : Paginator
$results array
return Paginator

Property Details

$currentOffset protected_oe property

The current entry offset number.
protected int $currentOffset
return integer

$currentPage protected_oe property

The current page number.
protected int $currentPage
return integer

$pages protected_oe property

The total amount of pages.
protected int $pages
return integer

$perPage protected_oe property

The amount of entries per page.
protected int $perPage
return integer

$results protected_oe property

The complete results array.
protected array $results
return array