proto library Client - Class RepeatedField (v5.36.2)

Reference documentation and code samples for the proto library Client class RepeatedField.

RepeatedField is used by generated protocol message classes to manipulate repeated fields. It can be used like native PHP array.

Namespace

Google \ Protobuf

Implements

\ArrayAccess
\IteratorAggregate
\Countable

Methods

offsetGet

Return the element at the given index.

This will also be called for: $ele = $arr[0]

Parameter
Name Description
offset int

The index of the element to be fetched.

Returns
Type Description
T The stored element at given index.

offsetSet

Assign the element at the given index.

This will also be called for: $arr []= $ele and $arr[0] = ele

Parameters
Name Description
offset int|null

The index of the element to be assigned.

value T

The element to be assigned.

Returns
Type Description
void

offsetUnset

Remove the element at the given index.

This will also be called for: unset($arr)

Parameter
Name Description
offset int

The index of the element to be removed.

Returns
Type Description
void

offsetExists

Check the existence of the element at the given index.

This will also be called for: isset($arr)

Parameter
Name Description
offset int

The index of the element to be removed.

Returns
Type Description
bool True if the element at the given offset exists.

count

Return the number of stored elements.

This will also be called for: count($arr)

Returns
Type Description
int The number of stored elements.

__debugInfo