A PHP representation of the CQL list datatype

Implements

Methods

__construct

( Cassandra\Type $type )

Creates a new collection of a given type.

Parameters:
Name Type Details
$type Cassandra\Type
Cassandra\Type

type

( )

The type of this collection.

Returns:
Type Details
Cassandra\Type
array

values

( )

Array of values in this collection.

Returns:
Type Details
array

values

int

add

( mixed $value )

Adds one or more values to this collection.

Parameters:
Name Type Details
$value mixed

one or more values to add

Returns:
Type Details
int

total number of values in this collection

mixed

get

( int $index )

Retrieves the value at a given index.

Parameters:
Name Type Details
$index int

Cassandra\Index

Returns:
Type Details
mixed

Cassandra\Value or null

int

find

( mixed $value )

Finds index of a value in this collection.

Parameters:
Name Type Details
$value mixed

Cassandra\Value

Returns:
Type Details
int

Cassandra\Index or null

int

count

( )

Total number of elements in this collection

Returns:
Type Details
int

count

mixed

current

( )

Current element for iteration

Returns:
Type Details
mixed

current element

int

key

( )

Current key for iteration

Returns:
Type Details
int

current key

void

next

( )

Move internal iterator forward

Returns:
Type Details
void
bool

valid

( )

Check whether a current value exists

Returns:
Type Details
bool
void

rewind

( )

Rewind internal iterator

Returns:
Type Details
void
bool

remove

( int $index )

Deletes the value at a given index

Parameters:
Name Type Details
$index int

Cassandra\Index

Returns:
Type Details
bool

Whether the value at a given index is correctly removed