PHP Class VersionPress\Git\GitLogPaginator

Afficher le fichier Open project: versionpress/versionpress Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( GitRepository $repository )
getPage ( $pageNumber ) : Commit[] Returns a subset of commits ordered from newest to oldest.
getPrettySteps ( $currentPage ) : array Returns a subset of pages useful for pagination.
isLastPage ( ) : boolean Returns true if the last loaded page was the last one.
setCommitsPerPage ( integer $commitsPerPage )
setQuery ( string $query )

Method Details

__construct() public méthode

public __construct ( GitRepository $repository )
$repository GitRepository

getPage() public méthode

Returns a subset of commits ordered from newest to oldest.
public getPage ( $pageNumber ) : Commit[]
$pageNumber
Résultat Commit[]

getPrettySteps() public méthode

For example if there are 1000 commits, 25 per page and you are on page 10, it returns 0,7,8,9,10,11,12,13,20,29,39. The algorithm is from VisualPaginator component for Nette Framework.
public getPrettySteps ( $currentPage ) : array
$currentPage
Résultat array

isLastPage() public méthode

Returns true if the last loaded page was the last one.
public isLastPage ( ) : boolean
Résultat boolean

setCommitsPerPage() public méthode

public setCommitsPerPage ( integer $commitsPerPage )
$commitsPerPage integer

setQuery() public méthode

public setQuery ( string $query )
$query string