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.

Extends

Methods

null

withName

( string $name )

Associate the user type with a name.

Parameters:
Name Type Details
$name string

Name of the user type.

Returns:
Type Details
null

Nothing.

string

name

( )

Returns type name for the user type

Returns:
Type Details
string

Name of this type

null

withKeyspace

( string $keyspace )

Associate the user type with a keyspace.

Parameters:
Name Type Details
$keyspace string

Cassandra\Keyspace that contains the user type.

Returns:
Type Details
null

Nothing.

string

keyspace

( )

Returns keyspace for the user type

Returns:
Type Details
string
string

__toString

( )

Returns type representation in CQL, e.g. keyspace1.type_name1 or userType<name1:varchar, name2:int>.

Returns:
Type Details
string

Cassandra\Type representation in CQL

array

types

( )

Returns types of values

Returns:
Type Details
array

An array of types

Cassandra\UserTypeValue

create

( mixed $value )

Creates a new Cassandra\UserTypeValue from the given name/value pairs. When no values given, creates an empty user type.

Parameters:
Name Type Details
$value mixed

One or more name/value pairs to be added to the user type.

Throws:
Type Details
Exception\InvalidArgumentException

when values given are of a different types than what the user type expects.

Returns:
Type Details
Cassandra\UserTypeValue

A user type value with given name/value pairs.