Interface Github\ResultPagerInterface

Implemented byGithub\ResultPager

Pager interface.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
fetch() Fetch a single result (page) from an api call. Github\ResultPagerInterface
fetchAll() Fetch all results (pages) from an api call. Github\ResultPagerInterface
fetchFirst() Fetch the first page. Github\ResultPagerInterface
fetchLast() Fetch the last page. Github\ResultPagerInterface
fetchNext() Fetch the next page. Github\ResultPagerInterface
fetchPrevious() Fetch the previous page. Github\ResultPagerInterface
getPagination() Github\ResultPagerInterface
hasNext() Check to determine the availability of a next page. Github\ResultPagerInterface
hasPrevious() Check to determine the availability of a previous page. Github\ResultPagerInterface
postFetch() Method that performs the actual work to refresh the pagination property. Github\ResultPagerInterface

Method Details

fetch() public abstract method

Fetch a single result (page) from an api call.

public abstract array fetch ( Github\Api\ApiInterface $api, $method, array $parameters = [] )
$api Github\Api\ApiInterface

The Api instance

$method string

The method name to call on the Api instance

$parameters array

The method parameters in an array

return array

Returns the result of the Api::$method() call

fetchAll() public abstract method

Fetch all results (pages) from an api call.

Use with care - there is no maximum.

public abstract array fetchAll ( Github\Api\ApiInterface $api, $method, array $parameters = [] )
$api Github\Api\ApiInterface

The Api instance

$method string

The method name to call on the Api instance

$parameters array

The method parameters in an array

return array

Returns a merge of the results of the Api::$method() call

fetchFirst() public abstract method

Fetch the first page.

public abstract array fetchFirst ( )
fetchLast() public abstract method

Fetch the last page.

public abstract array fetchLast ( )
fetchNext() public abstract method

Fetch the next page.

public abstract array fetchNext ( )
fetchPrevious() public abstract method

Fetch the previous page.

public abstract array fetchPrevious ( )
getPagination() public abstract method

public abstract null|array getPagination ( )
return null|array

Pagination result of last request

hasNext() public abstract method

Check to determine the availability of a next page.

public abstract bool hasNext ( )
hasPrevious() public abstract method

Check to determine the availability of a previous page.

public abstract bool hasPrevious ( )
postFetch() public abstract method

Method that performs the actual work to refresh the pagination property.

public abstract void postFetch ( )