Copied!

A collection of elements retrieved using one or more API calls. The collection will attempt to retrieve a fixed number of elements, and will make API calls until that fixed number is reached, or there are no more elements to retrieve.

CloneableInstantiableIterable
Methods
public __construct(Google\ApiCore\Page $initialPage, int $collectionSize)
 

FixedSizeCollection constructor.

  • param \Page $initialPage
  • param int $collectionSize
public getCollectionSize()
 

Returns the number of elements in the collection. This will be equal to the collectionSize parameter used at construction unless there are no elements remaining to be retrieved.

  • return int
public getIterator()
 

Returns an iterator over the elements of the collection.

  • return \Generator
  • attribute ReturnTypeWillChange
public getNextCollection()
 

Retrieves the next FixedSizeCollection using one or more API calls.

  • return \FixedSizeCollection
public getNextPageToken()
 

Returns a page token that can be passed into the API list method to retrieve additional elements.

  • return string
public hasNextCollection()
 

Returns true if there are more elements that can be retrieved from the API.

  • return bool
public iterateCollections()
 

Returns an iterator over FixedSizeCollections, starting with this and making API calls as required until all of the elements have been retrieved.

  • return \Generator|\FixedSizeCollection[]
Properties
private $collectionSize = NULL
private $pageList = NULL
Methods
private static createPageArray(Google\ApiCore\Page $initialPage, int $collectionSize)
 
  • param \Page $initialPage
  • param int $collectionSize
  • return \Page[]
private getLastPage()
Methods
private static createPageArray(Google\ApiCore\Page $initialPage, int $collectionSize)
 
  • param \Page $initialPage
  • param int $collectionSize
  • return \Page[]
© 2026 Bruce Wells
Search Namespaces \ Classes
Configuration