UserType
final class UserType extends Type (View source)
A class that represents a user type. The user type is able to represent a composite type of one or more types accessed by name.
Methods
Returns type name for the user type
Returns type representation in CQL, e.g. keyspace1.type_name1 or
userType<name1:varchar, name2:int>
.
Associate the user type with a name.
Associate the user type with a keyspace.
Returns keyspace for the user type
Returns types of values
Creates a new UserTypeValue from the given name/value pairs. When no values given, creates an empty user type.
Details
in
Type at line 3512
final static Type
ascii()
Get representation of ascii type
in
Type at line 3520
final static Type
bigint()
Get representation of bigint type
in
Type at line 3528
final static Type
smallint()
Get representation of smallint type
in
Type at line 3536
final static Type
tinyint()
Get representation of tinyint type
in
Type at line 3544
final static Type
blob()
Get representation of blob type
in
Type at line 3552
final static Type
boolean()
Get representation of boolean type
in
Type at line 3560
final static Type
counter()
Get representation of counter type
in
Type at line 3568
final static Type
decimal()
Get representation of decimal type
in
Type at line 3576
final static Type
double()
Get representation of double type
in
Type at line 3584
final static Type
duration()
Get representation of duration type
in
Type at line 3592
final static Type
float()
Get representation of float type
in
Type at line 3600
final static Type
int()
Get representation of int type
in
Type at line 3608
final static Type
text()
Get representation of text type
in
Type at line 3616
final static Type
timestamp()
Get representation of timestamp type
in
Type at line 3624
final static Type
date()
Get representation of date type
in
Type at line 3632
final static Type
time()
Get representation of time type
in
Type at line 3640
final static Type
uuid()
Get representation of uuid type
in
Type at line 3648
final static Type
varchar()
Get representation of varchar type
in
Type at line 3656
final static Type
varint()
Get representation of varint type
in
Type at line 3664
final static Type
timeuuid()
Get representation of timeuuid type
in
Type at line 3672
final static Type
inet()
Get representation of inet type
in
Type at line 3691
final static Type
collection(Type $type)
Initialize a Collection type
<?php
use Type;
$collection = Type::collection(Type::int()) ->create(1, 2, 3, 4, 5, 6, 7, 8, 9);
var_dump($collection);
in
Type at line 3710
final static Type
set(Type $type)
Initialize a set type
<?php
use Type;
$set = Type::set(Type::varchar()) ->create("a", "b", "c", "d", "e", "f", "g", "h", "i", "j");
var_dump($set);
in
Type at line 3728
final static Type
map(Type $keyType, Type $valueType)
Initialize a map type
use Type;
$map = Type::map(Type::int(), Type::varchar()) ->create(1, "a", 2, "b", 3, "c", 4, "d", 5, "e", 6, "f")
var_dump($map);```
in
Type at line 3745
final static Type
tuple(Type $types)
Initialize a tuple type
use Type;
$tuple = Type::tuple(Type::varchar(), Type::int()) ->create("a", 123);
var_dump($tuple);```
in
Type at line 3762
final static Type
userType(Type $types)
Initialize a user type
use Type;
$userType = Type::userType("a", Type::varchar(), "b", Type::int()) ->create("a", "abc", "b", 123);
var_dump($userType);```
string
name()
Returns type name for the user type
string
__toString()
Returns type representation in CQL, e.g. keyspace1.type_name1 or
userType<name1:varchar, name2:int>
.
null
withName(string $name)
Associate the user type with a name.
null
withKeyspace(string $keyspace)
Associate the user type with a keyspace.
string
keyspace()
Returns keyspace for the user type
array
types()
Returns types of values
UserTypeValue
create(mixed ...$value)
Creates a new UserTypeValue from the given name/value pairs. When no values given, creates an empty user type.