diff -r 000000000000 -r 4eba9c11703f web/Zend/Test/PHPUnit/Db/DataSet/DbTable.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/Zend/Test/PHPUnit/Db/DataSet/DbTable.php Mon Dec 13 18:29:26 2010 +0100 @@ -0,0 +1,125 @@ +tableName = $table->info('name'); + $this->_columns = $table->info('cols'); + + $this->_table = $table; + $this->_where = $where; + $this->_order = $order; + $this->_count = $count; + $this->_offset = $offset; + } + + /** + * Lazy load data via table fetchAll() method. + * + * @return void + */ + protected function loadData() + { + if ($this->data === null) { + $this->data = $this->_table->fetchAll( + $this->_where, $this->_order, $this->_count, $this->_offset + ); + if($this->data instanceof Zend_Db_Table_Rowset_Abstract) { + $this->data = $this->data->toArray(); + } + } + } + + /** + * Create Table Metadata object + */ + protected function createTableMetaData() + { + if ($this->tableMetaData === NULL) { + $this->loadData(); + $this->tableMetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData($this->tableName, $this->_columns); + } + } +} \ No newline at end of file