ZF-5323: Return the columns/fields for a row

Description

I think it would be useful to be able to get the columns/fields from a Row or Rowset from a Row you could do

 
function getColumns()
{
    return array_keys( $this->_data )
}

From a RowSet you will need to get the first Row (if there is one) then run the same getColumns call. I perdonally would use this when building a sort form so providing the ability to sort or not sort via one or more columns in the database.

Comments

Attached fix and unit tests

On second review, this functionality already exists (albeit in a slightly roundabout way). Both Row and Rowset supply a {{getTable()}} method, so this is possible:


$columns = $row->getTable()->info('cols');

I don't see any real added value to providing a {{getColumns}} wrapper around this at this late stage in ZFv1's lifecycle. If anyone disagrees, please feel free to reopen the issue.