Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct (CommandInterface $command, array $data=array()) | |
count () | |
current () | |
get ($key) | |
getNextToken () | |
getRequestCount () | |
key () | |
next () | |
rewind () | |
set ($key, $value) | |
setLimit ($limit) | |
setPageSize ($pageSize) | |
toArray () | |
valid () | |
![]() | |
addSubscriber (EventSubscriberInterface $subscriber) | |
dispatch ($eventName, array $context=array()) | |
getEventDispatcher () | |
setEventDispatcher (EventDispatcherInterface $eventDispatcher) | |
Static Public Member Functions | |
static | getAllEvents () |
Protected Member Functions | |
calculatePageSize () | |
resetState () | |
sendRequest () | |
Protected Attributes | |
$command | |
$data = array() | |
$invalid | |
$iteratedCount = 0 | |
$limit | |
$nextToken = false | |
$originalCommand | |
$pageSize | |
$requestCount = 0 | |
$resources | |
$retrievedCount = 0 | |
![]() | |
$eventDispatcher | |
Definition at line 8 of file ResourceIterator.php.
Guzzle\Service\Resource\ResourceIterator::__construct | ( | CommandInterface | $command, |
array | $data = array() |
||
) |
CommandInterface | $command | Initial command used for iteration |
array | $data | Associative array of additional parameters. You may specify any number of custom options for an iterator. Among these options, you may also specify the following values:
|
Definition at line 93 of file ResourceIterator.php.
References Guzzle\Service\Resource\ResourceIterator\$command, and Guzzle\Service\Resource\ResourceIterator\$data.
|
protected |
Returns the value that should be specified for the page size for a request that will maintain any hard limits, but still honor the specified pageSize if the number of items retrieved + pageSize < hard limit
Definition at line 260 of file ResourceIterator.php.
References Guzzle\Service\Resource\ResourceIterator\$iteratedCount, and Guzzle\Service\Resource\ResourceIterator\$pageSize.
Referenced by Guzzle\Tests\Service\Mock\Model\MockCommandIterator\sendRequest().
Guzzle\Service\Resource\ResourceIterator::count | ( | ) |
Definition at line 167 of file ResourceIterator.php.
References Guzzle\Service\Resource\ResourceIterator\$retrievedCount.
Referenced by Guzzle\Service\Resource\ResourceIterator\next().
Guzzle\Service\Resource\ResourceIterator::current | ( | ) |
Definition at line 157 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\valid().
Guzzle\Service\Resource\ResourceIterator::get | ( | $key | ) |
Get an option from the iterator
string | $key | Key of the option to retrieve |
Implements Guzzle\Service\Resource\ResourceIteratorInterface.
Definition at line 137 of file ResourceIterator.php.
|
static |
Get a list of all of the events emitted from the class
Reimplemented from Guzzle\Common\AbstractHasDispatcher.
Definition at line 76 of file ResourceIterator.php.
Referenced by Guzzle\Tests\Service\Resource\ResourceIteratorTest\testDescribesEvents().
Guzzle\Service\Resource\ResourceIterator::getNextToken | ( | ) |
Retrieve the NextToken that can be used in other iterators.
Implements Guzzle\Service\Resource\ResourceIteratorInterface.
Definition at line 249 of file ResourceIterator.php.
References Guzzle\Service\Resource\ResourceIterator\$nextToken.
Guzzle\Service\Resource\ResourceIterator::getRequestCount | ( | ) |
Get the total number of requests sent
Definition at line 177 of file ResourceIterator.php.
References Guzzle\Service\Resource\ResourceIterator\$requestCount.
Guzzle\Service\Resource\ResourceIterator::key | ( | ) |
Definition at line 162 of file ResourceIterator.php.
Guzzle\Service\Resource\ResourceIterator::next | ( | ) |
Reimplemented in Guzzle\Tests\Service\Mock\Model\MockCommandIterator.
Definition at line 199 of file ResourceIterator.php.
References Guzzle\Service\Resource\ResourceIterator\$originalCommand, Guzzle\Service\Resource\ResourceIterator\count(), Guzzle\Common\AbstractHasDispatcher\dispatch(), and Guzzle\Service\Resource\ResourceIterator\sendRequest().
Referenced by Guzzle\Service\Resource\ResourceIterator\rewind().
|
protected |
Reset the internal state of the iterator without triggering a rewind()
Definition at line 272 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\rewind(), Guzzle\Service\Resource\ResourceIterator\setLimit(), and Guzzle\Service\Resource\ResourceIterator\setPageSize().
Guzzle\Service\Resource\ResourceIterator::rewind | ( | ) |
Rewind the Iterator to the first element and send the original command
Definition at line 185 of file ResourceIterator.php.
References Guzzle\Service\Resource\ResourceIterator\$originalCommand, Guzzle\Service\Resource\ResourceIterator\next(), and Guzzle\Service\Resource\ResourceIterator\resetState().
|
abstractprotected |
Send a request to retrieve the next page of results. Hook for subclasses to implement.
Reimplemented in Guzzle\Tests\Service\Mock\Model\MockCommandIterator.
Referenced by Guzzle\Service\Resource\ResourceIterator\next().
Guzzle\Service\Resource\ResourceIterator::set | ( | $key, | |
$value | |||
) |
Set an option on the iterator
string | $key | Key of the option to set |
mixed | $value | Value to set for the option |
Implements Guzzle\Service\Resource\ResourceIteratorInterface.
Definition at line 150 of file ResourceIterator.php.
Guzzle\Service\Resource\ResourceIterator::setLimit | ( | $limit | ) |
Attempt to limit the total number of resources returned by the iterator.
You may still receive more items than you specify. Set to 0 to specify no limit.
int | $limit | Limit amount |
Implements Guzzle\Service\Resource\ResourceIteratorInterface.
Definition at line 114 of file ResourceIterator.php.
References Guzzle\Service\Resource\ResourceIterator\$limit, and Guzzle\Service\Resource\ResourceIterator\resetState().
Guzzle\Service\Resource\ResourceIterator::setPageSize | ( | $pageSize | ) |
Attempt to limit the total number of resources retrieved per request by the iterator.
The iterator may return more than you specify in the page size argument depending on the service and underlying command implementation. Set to 0 to specify no page size limitation.
int | $pageSize | Limit amount |
Implements Guzzle\Service\Resource\ResourceIteratorInterface.
Definition at line 122 of file ResourceIterator.php.
References Guzzle\Service\Resource\ResourceIterator\$pageSize, and Guzzle\Service\Resource\ResourceIterator\resetState().
Guzzle\Service\Resource\ResourceIterator::toArray | ( | ) |
Get all of the resources as an array (Warning: this could issue a large number of requests)
Implements Guzzle\Common\ToArrayInterface.
Definition at line 109 of file ResourceIterator.php.
Guzzle\Service\Resource\ResourceIterator::valid | ( | ) |
Definition at line 193 of file ResourceIterator.php.
References Guzzle\Service\Resource\ResourceIterator\$nextToken, and Guzzle\Service\Resource\ResourceIterator\current().
|
protected |
Command used to send requests
Definition at line 14 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\__construct().
|
protected |
Initial data passed to the constructor
Definition at line 68 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\__construct(), and Guzzle\Tests\Service\Mock\Model\MockCommandIterator\sendRequest().
|
protected |
Whether or not the current value is known to be invalid
Definition at line 74 of file ResourceIterator.php.
|
protected |
Total number of resources that have been iterated
Definition at line 38 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\calculatePageSize(), and Guzzle\Tests\Service\Mock\Model\MockCommandIterator\getIteratedCount().
|
protected |
Maximum number of resources to retrieve in total
Definition at line 56 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\setLimit().
|
protected |
NextToken/Marker for a subsequent request
Definition at line 44 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\getNextToken(), and Guzzle\Service\Resource\ResourceIterator\valid().
|
protected |
First sent command
Definition at line 20 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\next(), and Guzzle\Service\Resource\ResourceIterator\rewind().
|
protected |
Maximum number of resources to fetch per request
Definition at line 50 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\calculatePageSize(), and Guzzle\Service\Resource\ResourceIterator\setPageSize().
|
protected |
Number of requests sent
Definition at line 62 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\getRequestCount().
|
protected |
Currently loaded resources
Definition at line 26 of file ResourceIterator.php.
Referenced by Guzzle\Tests\Service\Mock\Model\MockCommandIterator\getResources().
|
protected |
Total number of resources that have been retrieved
Definition at line 32 of file ResourceIterator.php.
Referenced by Guzzle\Service\Resource\ResourceIterator\count().