Cassandra\Type::map PHP Method

map() final static public method

Initialize a map type
final static public map ( cassandra\Type $key_type, cassandra\Type $value_type ) : cassandra\Type
$key_type cassandra\Type The type of keys
$value_type cassandra\Type The type of values
return cassandra\Type The map type
    static final function map(Type $key_type, Type $value_type)
    {
    }

Usage Example

Example #1
0
 public function testSupportsKeyBasedAccess()
 {
     $map = Type::map(Type::varint(), Type::varchar())->create();
     $this->assertEquals(0, count($map));
     $map->set(new Varint('123'), 'value');
     $this->assertEquals(1, count($map));
     $this->assertTrue($map->has(new Varint('123')));
     $this->assertEquals('value', $map->get(new Varint('123')));
     $map->set(new Varint('123'), 'another value');
     $this->assertEquals(1, count($map));
     $this->assertEquals('another value', $map->get(new Varint('123')));
 }
All Usage Examples Of Cassandra\Type::map