1: <?php
2:
3: namespace Guzzle\Service\Resource;
4:
5: use Guzzle\Common\HasDispatcherInterface;
6: use Guzzle\Common\ToArrayInterface;
7:
8: /**
9: * Iterates over a paginated resource using subsequent requests in order to retrieve the entire matching result set
10: */
11: interface ResourceIteratorInterface extends ToArrayInterface, HasDispatcherInterface, \Iterator, \Countable
12: {
13: /**
14: * Retrieve the NextToken that can be used in other iterators.
15: *
16: * @return string Returns a NextToken
17: */
18: public function getNextToken();
19:
20: /**
21: * Attempt to limit the total number of resources returned by the iterator.
22: *
23: * You may still receive more items than you specify. Set to 0 to specify no limit.
24: *
25: * @param int $limit Limit amount
26: *
27: * @return ResourceIteratorInterface
28: */
29: public function setLimit($limit);
30:
31: /**
32: * Attempt to limit the total number of resources retrieved per request by the iterator.
33: *
34: * The iterator may return more than you specify in the page size argument depending on the service and underlying
35: * command implementation. Set to 0 to specify no page size limitation.
36: *
37: * @param int $pageSize Limit amount
38: *
39: * @return ResourceIteratorInterface
40: */
41: public function setPageSize($pageSize);
42:
43: /**
44: * Get a data option from the iterator
45: *
46: * @param string $key Key of the option to retrieve
47: *
48: * @return mixed|null Returns NULL if not set or the value if set
49: */
50: public function get($key);
51:
52: /**
53: * Set a data option on the iterator
54: *
55: * @param string $key Key of the option to set
56: * @param mixed $value Value to set for the option
57: *
58: * @return ResourceIteratorInterface
59: */
60: public function set($key, $value);
61: }
62: