Copied!

MapFieldIter is used to iterate MapField. It is also need for the foreach syntax.

CloneableInstantiableIterable
Methods
public __construct( $container, $key_type)
 

Create iterator instance for MapField.

  • param array $container
  • param \GPBType $key_type Map key type.
  • ignore
public current()
 

Return the element at the current position.

  • return object The element at the current position.
  • todo need to add return type mixed (require update php version to 8.0)
  • attribute ReturnTypeWillChange
public key()
 

Return the current key.

  • return object The current key.
  • todo need to add return type mixed (require update php version to 8.0)
  • attribute ReturnTypeWillChange
public next()
 

Move to the next position.

  • return void
  • todo need to add return type void (require update php version to 7.1)
  • attribute ReturnTypeWillChange
public rewind()
 

Reset the status of the iterator

  • return void
  • todo need to add return type void (require update php version to 7.1)
  • attribute ReturnTypeWillChange
public valid() : bool
 

Check whether there are more elements to iterate.

  • return bool True if there are more elements to iterate.
Properties
private $container = NULL
 
  • ignore
private $key_type = NULL
 
  • ignore
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration