A PHP representation of the CQL map datatype

Implements

Methods

__construct

( Dse\Type $keyType, Dse\Type $valueType )

Creates a new map of a given key and value type.

Parameters:
Name Type Details
$keyType Dse\Type
$valueType Dse\Type
Dse\Type

type

( )

The type of this map.

Returns:
Type Details
Dse\Type
array

keys

( )

Returns all keys in the map as an array.

Returns:
Type Details
array

keys

array

values

( )

Returns all values in the map as an array.

Returns:
Type Details
array

values

mixed

set

( mixed $key, mixed $value )

Sets key/value in the map.

Parameters:
Name Type Details
$key mixed

key

$value mixed

value

Returns:
Type Details
mixed
mixed

get

( mixed $key )

Gets the value of the key in the map.

Parameters:
Name Type Details
$key mixed

Key

Returns:
Type Details
mixed

Dse\Value or null

bool

remove

( mixed $key )

Removes the key from the map.

Parameters:
Name Type Details
$key mixed

Key

Returns:
Type Details
bool

Whether the key was removed or not, e.g. didn’t exist

bool

has

( mixed $key )

Returns whether the key is in the map.

Parameters:
Name Type Details
$key mixed

Key

Returns:
Type Details
bool

Whether the key is in the map or not

int

count

( )

Total number of elements in this map

Returns:
Type Details
int

count

mixed

current

( )

Current value for iteration

Returns:
Type Details
mixed

current value

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
void

offsetSet

( mixed $key, mixed $value )

Sets the value at a given key

Parameters:
Name Type Details
$key mixed

Key to use.

$value mixed

Dse\Value to set.

Throws:
Type Details
Exception\InvalidArgumentException

when the type of key or value is wrong

Returns:
Type Details
void
mixed

offsetGet

( mixed $key )

Retrieves the value at a given key

Parameters:
Name Type Details
$key mixed

Key to use.

Throws:
Type Details
Exception\InvalidArgumentException

when the type of key is wrong

Returns:
Type Details
mixed

Dse\Value or null

void

offsetUnset

( mixed $key )

Deletes the value at a given key

Parameters:
Name Type Details
$key mixed

Key to use.

Throws:
Type Details
Exception\InvalidArgumentException

when the type of key is wrong

Returns:
Type Details
void
bool

offsetExists

( mixed $key )

Returns whether the value a given key is present

Parameters:
Name Type Details
$key mixed

Key to use.

Throws:
Type Details
Exception\InvalidArgumentException

when the type of key is wrong

Returns:
Type Details
bool

Whether the value at a given key is present