Paginator for pages returned via API results

package Library
subpackage Twilio\Api\Resource\Listing
author Aleksey Korzun

 Methods

Class constructor

__construct(mixed $generator, int $page, string[] $filters, int $size) 

Parameters

$generator

mixed

$page

int

$filters

string[]

$size

int

Disable build in method by overwriting it

count() 

Current item

current() : mixed

Returns

mixed

Current key

key() : mixed

Returns

mixed

Return the next item in the list, making another HTTP call to the next page of resources if necessary.

next() 

Restore everything to the way it was before we began paging.

rewind() 

This gets called at the beginning of any foreach() loop

Overwrites default method to check if current position is valid

valid() 

Fill $this->items with a new page from the API, if necessary.

loadIfNecessary() : bool

Returns

bool

 Properties

 

$filters : string[]
 

$generator : mixed
 

$items : string[]
 

$nextUri : string
 

$page : int
 

$size : int
 

$snapshot : string[]

 Constants

 

Default size of pages

DEFAULT_PAGE_SIZE : int