PHP Class VersionPress\Git\GitLogPaginator

ファイルを表示 Open project: versionpress/versionpress Class Usage Examples

Public Methods

Method 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 method

public __construct ( GitRepository $repository )
$repository GitRepository

getPage() public method

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

getPrettySteps() public method

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
return array

isLastPage() public method

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

setCommitsPerPage() public method

public setCommitsPerPage ( integer $commitsPerPage )
$commitsPerPage integer

setQuery() public method

public setQuery ( string $query )
$query string