PHP Class Cassandra\Collection

Inheritance: implements Countable, implements Iterator
Show file Open project: datastax/php-driver

Public Methods

Method Description
__construct ( cassandra\Type $type ) Creates a new collection of a given type.
add ( $value ) : integer Adds one or more values to this collection.
count ( ) : integer Total number of elements in this collection
current ( ) : mixed Current element for iteration
find ( mixed $value ) : integer Finds index of a value in this collection.
get ( integer $index ) : mixed Retrieves the value at a given index.
key ( ) : integer Current key for iteration
next ( ) : void Move internal iterator forward
remove ( integer $index ) : boolean Deletes the value at a given index
rewind ( ) : void Rewind internal iterator
type ( ) : cassandra\Type The type of this collection.
valid ( ) : boolean Check whether a current value exists
values ( ) : array Array of values in this collection.

Method Details

__construct() public method

Creates a new collection of a given type.
public __construct ( cassandra\Type $type )
$type cassandra\Type

add() public method

Adds one or more values to this collection.
public add ( $value ) : integer
return integer total number of values in this collection

count() public method

Total number of elements in this collection
public count ( ) : integer
return integer count

current() public method

Current element for iteration
public current ( ) : mixed
return mixed current element

find() public method

Finds index of a value in this collection.
public find ( mixed $value ) : integer
$value mixed Value
return integer Index or null

get() public method

Retrieves the value at a given index.
public get ( integer $index ) : mixed
$index integer Index
return mixed Value or null

key() public method

Current key for iteration
public key ( ) : integer
return integer current key

next() public method

Move internal iterator forward
public next ( ) : void
return void

remove() public method

Deletes the value at a given index
public remove ( integer $index ) : boolean
$index integer Index
return boolean Whether the value at a given index is correctly removed

rewind() public method

Rewind internal iterator
public rewind ( ) : void
return void

type() public method

The type of this collection.
public type ( ) : cassandra\Type
return cassandra\Type

valid() public method

Check whether a current value exists
public valid ( ) : boolean
return boolean

values() public method

Array of values in this collection.
public values ( ) : array
return array values