PHP Class Cassandra\Map

Inheritance: implements Countable, implements Iterator, implements ArrayAccess
Show file Open project: datastax/php-driver Class Usage Examples

Public Methods

Method Description
__construct ( cassandra\Type $keyType, cassandra\Type $valueType ) Creates a new map of a given key and value type.
count ( ) : integer Total number of elements in this map
current ( ) : mixed Current value for iteration
get ( mixed $key ) : mixed Gets the value of the key in the map.
has ( mixed $key ) : boolean Returns whether the key is in the map.
key ( ) : integer Current key for iteration
keys ( ) : array Returns all keys in the map as an array.
next ( ) : void Move internal iterator forward
offsetExists ( mixed $key ) : boolean Returns whether the value a given key is present
offsetGet ( mixed $key ) : mixed Retrieves the value at a given key
offsetSet ( mixed $key, mixed $value ) : void Sets the value at a given key
offsetUnset ( mixed $key ) : void Deletes the value at a given key
remove ( mixed $key ) : boolean Removes the key from the map.
rewind ( ) : void Rewind internal iterator
set ( mixed $key, mixed $value ) Sets key/value in the map.
type ( ) : cassandra\Type The type of this map.
valid ( ) : boolean Check whether a current value exists
values ( ) : array Returns all values in the map as an array.

Method Details

__construct() public method

Creates a new map of a given key and value type.
public __construct ( cassandra\Type $keyType, cassandra\Type $valueType )
$keyType cassandra\Type
$valueType cassandra\Type

count() public method

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

current() public method

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

get() public method

Gets the value of the key in the map.
public get ( mixed $key ) : mixed
$key mixed Key
return mixed Value or null

has() public method

Returns whether the key is in the map.
public has ( mixed $key ) : boolean
$key mixed Key
return boolean Whether the key is in the map or not

key() public method

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

keys() public method

Returns all keys in the map as an array.
public keys ( ) : array
return array keys

next() public method

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

offsetExists() public method

Returns whether the value a given key is present
public offsetExists ( mixed $key ) : boolean
$key mixed Key to use.
return boolean Whether the value at a given key is present

offsetGet() public method

Retrieves the value at a given key
public offsetGet ( mixed $key ) : mixed
$key mixed Key to use.
return mixed Value or `null`

offsetSet() public method

Sets the value at a given key
public offsetSet ( mixed $key, mixed $value ) : void
$key mixed Key to use.
$value mixed Value to set.
return void

offsetUnset() public method

Deletes the value at a given key
public offsetUnset ( mixed $key ) : void
$key mixed Key to use.
return void

remove() public method

Removes the key from the map.
public remove ( mixed $key ) : boolean
$key mixed Key
return boolean Whether the key was removed or not, e.g. didn't exist

rewind() public method

Rewind internal iterator
public rewind ( ) : void
return void

set() public method

Sets key/value in the map.
public set ( mixed $key, mixed $value )
$key mixed key
$value mixed value

type() public method

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

valid() public method

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

values() public method

Returns all values in the map as an array.
public values ( ) : array
return array values