Initialize a Collection type
final static public collection ( cassandra\Type $type ) : cassandra\Type | ||
$type | cassandra\Type | The type of values |
return | cassandra\Type | The collection type |
public function notEqualTypes() { return array(array(Type::collection(Type::varchar()), Type::collection(Type::int())), array(Type::collection(Type::collection(Type::varchar())), Type::collection(Type::collection(Type::int()))), array(Type::collection(Type::collection(Type::int())), Type::collection(Type::set(Type::int())))); }
public function compositeTypes() { return array(array(Type::map(Type::varchar(), Type::varchar())), array(Type::set(Type::varchar())), array(Type::collection(Type::varchar()))); }
public function notEqualTypes() { return array(array(Type::userType('a', Type::int()), Type::userType('a', Type::varchar())), array(Type::userType('a', Type::int(), 'b', Type::varchar()), Type::userType('a', Type::int(), 'b', Type::bigint())), array(Type::userType('a', Type::int(), 'b', Type::varchar(), 'c', Type::varint()), Type::userType('a', Type::int(), 'b', Type::varchar(), 'c', Type::bigint())), array(Type::userType('a', Type::collection(Type::int()), 'b', Type::set(Type::varchar())), Type::userType('a', Type::collection(Type::int()), 'b', Type::set(Type::int()))), array(Type::userType('a', Type::int()), Type::userType('b', Type::int())), array(Type::userType('a', Type::int(), 'c', Type::varchar()), Type::userType('b', Type::int(), 'c', Type::varchar()))); }
/** * @expectedException InvalidArgumentException * @expectedExceptionMessage type must be Cassandra\Type::varchar(), * Cassandra\Type::text(), Cassandra\Type::blob(), * Cassandra\Type::ascii(), Cassandra\Type::bigint(), * Cassandra\Type::counter(), Cassandra\Type::int(), * Cassandra\Type::varint(), Cassandra\Type::boolean(), * Cassandra\Type::decimal(), Cassandra\Type::double(), * Cassandra\Type::float(), Cassandra\Type::inet(), * Cassandra\Type::timestamp(), Cassandra\Type::uuid() * or Cassandra\Type::timeuuid(), an instance of * Cassandra\Type\UnsupportedType given */ public function testPreventsDefiningCollectionsWithUnsupportedTypes() { Type::collection(new UnsupportedType()); }