PHP Class Braintree\ResourceCollection

stores and retrieves search results and aggregate data example: $result = Customer::all(); foreach($result as $transaction) { print_r($transaction->id); }
Inheritance: implements Iterato\Iterator
Show file Open project: braintree/braintree_php Class Usage Examples

Public Methods

Method Description
__construct ( array $response, array $pager ) set up the resource collection
current ( ) returns the current item when iterating with foreach
firstItem ( ) : mixed returns the first item in the collection
getIds ( ) : array returns all IDs in the collection
key ( )
maximumCount ( )
next ( ) advances to the next item in the collection when iterating with foreach
rewind ( ) rewinds the testIterateOverResults collection to the first item when iterating with foreach
valid ( ) returns whether the current item is valid when iterating with foreach

Private Methods

Method Description
_getNextPage ( )
_getPage ( $ids ) : void requests the next page of results for the collection

Method Details

__construct() public method

expects an array of attributes with literal keys
public __construct ( array $response, array $pager )
$response array
$pager array

current() public method

returns the current item when iterating with foreach
public current ( )

firstItem() public method

returns the first item in the collection
public firstItem ( ) : mixed
return mixed

getIds() public method

returns all IDs in the collection
public getIds ( ) : array
return array

key() public method

public key ( )

maximumCount() public method

public maximumCount ( )

next() public method

advances to the next item in the collection when iterating with foreach
public next ( )

rewind() public method

rewinds the testIterateOverResults collection to the first item when iterating with foreach
public rewind ( )

valid() public method

returns whether the current item is valid when iterating with foreach
public valid ( )