Collection
final class Collection implements Value, Countable, Iterator (View source)
A PHP representation of the CQL list datatype
Methods
Array of values in this collection.
Adds one or more values to this collection.
Retrieves the value at a given index.
Finds index of a value in this collection.
Total number of elements in this collection
Current element for iteration
Current key for iteration
Move internal iterator forward
Check whether a current value exists
Rewind internal iterator
Deletes the value at a given index
Details
__construct(Type $type)
Creates a new collection of a given type.
Type
type()
The type of this collection.
array
values()
Array of values in this collection.
int
add(mixed ...$value)
Adds one or more values to this collection.
mixed
get(int $index)
Retrieves the value at a given index.
int
find(mixed $value)
Finds index of a value in this collection.
int<0, max>
count()
Total number of elements in this collection
TValue
current()
Current element for iteration
TKey|null
key()
Current key for iteration
void
next()
Move internal iterator forward
bool
valid()
Check whether a current value exists
void
rewind()
Rewind internal iterator
bool
remove(int $index)
Deletes the value at a given index