crunchbutton/include/library/Github/ResultPagerInterface.php
Devin Smith 41e8600690 more deployment changes
partial #3787
added support for deployment to any repo path.
added tagging system
2014-11-18 16:08:23 -08:00

85 lines
2.0 KiB
PHP
Executable File

<?php
namespace Github;
use Github\Api\ApiInterface;
/**
* Pager interface
*
* @author Ramon de la Fuente <ramon@future500.nl>
* @author Mitchel Verschoof <mitchel@future500.nl>
*/
interface ResultPagerInterface
{
/**
* @return null|array pagination result of last request
*/
public function getPagination();
/**
* Fetch a single result (page) from an api call
*
* @param ApiInterface $api the Api instance
* @param string $method the method name to call on the Api instance
* @param array $parameters the method parameters in an array
*
* @return array returns the result of the Api::$method() call
*/
public function fetch(ApiInterface $api, $method, array $parameters = array());
/**
* Fetch all results (pages) from an api call
* Use with care - there is no maximum
*
* @param ApiInterface $api the Api instance
* @param string $method the method name to call on the Api instance
* @param array $parameters the method parameters in an array
*
* @return array returns a merge of the results of the Api::$method() call
*/
public function fetchAll(ApiInterface $api, $method, array $parameters = array());
/**
* Method that performs the actual work to refresh the pagination property
*/
public function postFetch();
/**
* Check to determine the availability of a next page
* @return bool
*/
public function hasNext();
/**
* Check to determine the availability of a previous page
* @return bool
*/
public function hasPrevious();
/**
* Fetch the next page
* @return array
*/
public function fetchNext();
/**
* Fetch the previous page
* @return array
*/
public function fetchPrevious();
/**
* Fetch the first page
* @return array
*/
public function fetchFirst();
/**
* Fetch the last page
* @return array
*/
public function fetchLast();
}