Pregunta

I am storing data with row key made up of CassandraUtil::UUID4(). Now I have upgraded the version of phpcassa to 1.0.6. When I am making "get_indexed_slices" call for the column family it returns the iterator object. Key for the iterator is very weared.

O:13:"phpcassa\UUID":8:{s:8:"*bytes";s:16:"A*´õè=C¼°Òk&”Ÿ";s:6:"*hex";N;s:9:"*string";s:36:"412ab4f5-e83d-43bc-b0d2-6b269400019f";s:6:"*urn";N;s:10:"*version";N;s:10:"*variant";N;s:7:"*node";N;s:7:"*time";N;}

I am clueless how to get value of the key from above string. Looks like PHPCASSA is serializng some object and using it as a key.If so can you tell me the we functions that will be available in the unserialized object?

Does anybody have an idea?

¿Fue útil?

Solución

On debugging I come to know about class "phpcassa\Schema\DataType\UUIDType"

Pack method in the class is doing exactly what I am looking for.

$Obj = unserialize($value);
$Obj->bytes

will gives us the byets value of the UUID4.

Posting it for future reference to my friends on internet.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top