Do you want to get names directly and only with phpCassa? I donβt know how to do this directly, but I used this by getting the whole row and then executing the foreach loop on the array that I have from the column family, for example:
1.- A small function to use everywhere (create your own if you need;)):
function f_get_data_as_array($p_pool, $p_cf, $p_key, $p_col_count = 100, $p_column_names = NULL, $p_range_start = '', $p_range_end = '', $p_inverted_sort = false) { try{ $lv_slice = new ColumnSlice($p_range_start, $p_range_end, $p_col_count, p_inverted_sort); $lv_cf = new ColumnFamily($p_pool, $p_cf); $lv_cf->insert_format = ColumnFamily::ARRAY_FORMAT; $lv_cf->return_format = ColumnFamily::ARRAY_FORMAT; $lv_result = $lv_cf->get($p_key, $lv_slice, $p_column_names); }catch(Exception $lv_e) { return false; } return $lv_result;
2.- I call this using the first four parameters, setting the pool, the name of the column family, the key I need and the number of columns I want to get (specify the number you need).
3.- Run a foreach loop on the returned array to get each column name. Or, if you know the structure that you get from your column family, you just need to use the necessary indexes, perhaps: $ lv_result [0] [0], $ lv_result [0] [1] and so ...
Hope this helps. And sorry for my english!
source share