/** * Add a deletion to the buffer. * * @param phpcassa\ColumnFamily $column_family an initialized * ColumnFamily instance * @param mixed $key the row key * @param mixed[] $columns a list of columns or super columns to delete * @param mixed $supercolumn if you want to delete only some subcolumns from * a single super column, set this to the super column name * @param int $timestamp an optional timestamp (default is "now", when * this function is called, not when send() is called) */ public function remove($column_family, $key, $columns = null, $super_column = null, $timestamp = null) { if ($timestamp === null) { $timestamp = Clock::get_time(); } $deletion = new Deletion(); $deletion->timestamp = $timestamp; if ($super_column !== null) { $deletion->super_column = $column_family->pack_name($super_column, true); } if ($columns !== null) { $is_super = $column_family->is_super && $super_column === null; $packed_cols = array(); foreach ($columns as $col) { $packed_cols[] = $column_family->pack_name($col, $is_super); } $predicate = new SlicePredicate(); $predicate->column_names = $packed_cols; $deletion->predicate = $predicate; } $mutation = new Mutation(); $mutation->deletion = $deletion; $packed_key = $column_family->pack_key($key); $this->enqueue($packed_key, $column_family, array($mutation)); return $this; }