Implements

Methods

string

name

( )

Returns “map”

Returns:
Type Details
string

“map”

string

__toString

( )

Returns type representation in CQL, e.g. map<varchar, int>

Returns:
Type Details
string

Cassandra\Type representation in CQL

Cassandra\Type

keyType

( )

Returns type of keys

Returns:
Type Details
Cassandra\Type

Cassandra\Type of keys

Cassandra\Type

valueType

( )

Returns type of values

Returns:
Type Details
Cassandra\Type

Cassandra\Type of values

Cassandra\Map

create

( mixed $value = null )

Creates a new Cassandra\Map from the given values.

<?php
use Cassandra\Type;
use Cassandra\Uuid;

$type = Type::map(Type::uuid(), Type::varchar());
$map = $type->create(new Uuid(), 'first uuid',
                     new Uuid(), 'second uuid',
                     new Uuid(), 'third uuid');

var_dump($map);
Parameters:
Name Type Details
$value mixed

An even number of values, where each odd value is a key and each even value is a value for the map, e.g. create(key, value, key, value). When no values given, creates an empty map.

Throws:
Type Details
Exception\InvalidArgumentException

when keys or values given are of a different type than what this map type expects.

Returns:
Type Details
Cassandra\Map

A set with given values.