Overview

Namespaces

  • cassandra
  • None
  • PHP
  • phpcassa
    • Batch
    • Connection
    • Index
    • Iterator
    • Schema
      • DataType
    • Util
    • UUID

Classes

  • AsciiType
  • BooleanType
  • BytesType
  • CassandraType
  • CompositeType
  • DateType
  • DoubleType
  • FloatType
  • Int32Type
  • IntegerType
  • LexicalUUIDType
  • LongType
  • TimeUUIDType
  • UTF8Type
  • UUIDType

Interfaces

  • Serialized
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace phpcassa\Schema\DataType;
 3: 
 4: use phpcassa\Schema\DataType\Serialized;
 5: use phpcassa\UUID;
 6: 
 7: /**
 8:  * Handles any type of UUID.
 9:  *
10:  * @package phpcassa\Schema\DataType
11:  */
12: class UUIDType extends CassandraType implements Serialized
13: {
14:     public function pack($value, $is_name=true, $slice_end=null, $is_data=false) {
15:         if ($is_name && $is_data)
16:             $value = unserialize($value);
17:         return $value->bytes;
18:     }
19: 
20:     public function unpack($data, $handle_serialize=true) {
21:         $value = UUID::import($data);
22:         if ($handle_serialize) {
23:             return serialize($value);
24:         } else {
25:             return $value;
26:         }
27:     }
28: }
29: 
phpcassa API documentation generated by ApiGen 2.8.0