Index: library/Zend/Db/Table/Rowset/Abstract.php =================================================================== --- library/Zend/Db/Table/Rowset/Abstract.php (revision 24794) +++ library/Zend/Db/Table/Rowset/Abstract.php (working copy) @@ -220,6 +220,16 @@ } /** + * Retrieves the column names of the rows in this rowset + * + * @return array + */ + public function getColumns() + { + return $this->getTable()->info('cols'); + } + + /** * Rewind the Iterator to the first element. * Similar to the reset() function for arrays in PHP. * Required by interface Iterator. Index: library/Zend/Db/Table/Row/Abstract.php =================================================================== --- library/Zend/Db/Table/Row/Abstract.php (revision 24794) +++ library/Zend/Db/Table/Row/Abstract.php (working copy) @@ -685,6 +685,16 @@ } /** + * Retrieves the column names of this row + * + * @return array + */ + public function getColumns() + { + return $this->_getTable()->info('cols'); + } + + /** * Retrieves an instance of the parent table. * * @return Zend_Db_Table_Abstract Index: tests/Zend/Db/Table/Rowset/TestCommon.php =================================================================== --- tests/Zend/Db/Table/Rowset/TestCommon.php (revision 24794) +++ tests/Zend/Db/Table/Rowset/TestCommon.php (working copy) @@ -203,6 +203,26 @@ $this->assertEquals($table, $rows->getTable()); } + /** + * @group ZF-5323 + */ + public function testTableRowGetColumns() + { + $table = $this->_table['bugs']; + $rowSet = $table->find(1); + $cols = array( + 'bug_id', + 'bug_description', + 'bug_status', + 'created_on', + 'updated_on', + 'reported_by', + 'assigned_to', + 'verified_by', + ); + $this->assertEquals($cols, $rowSet->getColumns()); + } + public function testTableRowsetGetTableClass() { $table = $this->_table['bugs']; Index: tests/Zend/Db/Table/Row/TestCommon.php =================================================================== --- tests/Zend/Db/Table/Row/TestCommon.php (revision 24794) +++ tests/Zend/Db/Table/Row/TestCommon.php (working copy) @@ -194,6 +194,26 @@ $this->assertEquals($cols, array_keys($a)); } + /** + * @group ZF-5323 + */ + public function testTableRowGetColumns() + { + $table = $this->_table['bugs']; + $row = $table->find(1)->current(); + $cols = array( + 'bug_id', + 'bug_description', + 'bug_status', + 'created_on', + 'updated_on', + 'reported_by', + 'assigned_to', + 'verified_by', + ); + $this->assertEquals($cols, $row->getColumns()); + } + public function testTableRowSelect() { $table = $this->_table['bugs'];