original_string: protected function renderTable($table)
      {
          $array = array();
  
          foreach ($table->getRows() as $id => $row) {
              $newRow = array(
                  'columns'        => $row->getColumns(),
                  'metadata'       => $row->getMetadata(),
                  'idsubdatatable' => $row->getIdSubDataTable(),
              );
  
              if ($id == DataTable::ID_SUMMARY_ROW) {
                  $newRow['issummaryrow'] = true;
              }
  
              $subTable = $row->getSubtable();
              if ($this->isRenderSubtables()
                  && $subTable
              ) {
                  $subTable = $this->renderTable($subTable);
                  $newRow['subtable'] = $subTable;
                  if ($this->hideIdSubDatatable === false
                      && isset($newRow['metadata']['idsubdatatable_in_db'])
                  ) {
                      $newRow['columns']['idsubdatatable'] = $newRow['metadata']['idsubdatatable_in_db'];
                  }
                  unset($newRow['metadata']['idsubdatatable_in_db']);
              }
              if ($this->hideIdSubDatatable !== false) {
                  unset($newRow['idsubdatatable']);
              }
  
              $array[] = $newRow;
          }
          return $array;
      }
code: protected function renderTable($table)
      {
          $array = array();
  
          foreach ($table->getRows() as $id => $row) {
              $newRow = array(
                  'columns'        => $row->getColumns(),
                  'metadata'       => $row->getMetadata(),
                  'idsubdatatable' => $row->getIdSubDataTable(),
              );
  
              if ($id == DataTable::ID_SUMMARY_ROW) {
                  $newRow['issummaryrow'] = true;
              }
  
              $subTable = $row->getSubtable();
              if ($this->isRenderSubtables()
                  && $subTable
              ) {
                  $subTable = $this->renderTable($subTable);
                  $newRow['subtable'] = $subTable;
                  if ($this->hideIdSubDatatable === false
                      && isset($newRow['metadata']['idsubdatatable_in_db'])
                  ) {
                      $newRow['columns']['idsubdatatable'] = $newRow['metadata']['idsubdatatable_in_db'];
                  }
                  unset($newRow['metadata']['idsubdatatable_in_db']);
              }
              if ($this->hideIdSubDatatable !== false) {
                  unset($newRow['idsubdatatable']);
              }
  
              $array[] = $newRow;
          }
          return $array;
      }
code_tokens: protected function renderTable ( $ table ) { $ array = array ( ) ; foreach ( $ table -> getRows ( ) as $ id => $ row ) { $ newRow = array ( 'columns' => $ row -> getColumns ( ) , 'metadata' => $ row -> getMetadata ( ) , 'idsubdatatable' => $ row -> getIdSubDataTable ( ) , ) ; if ( $ id == DataTable :: ID_SUMMARY_ROW ) { $ newRow [ 'issummaryrow' ] = true ; } $ subTable = $ row -> getSubtable ( ) ; if ( $ this -> isRenderSubtables ( ) && $ subTable ) { $ subTable = $ this -> renderTable ( $ subTable ) ; $ newRow [ 'subtable' ] = $ subTable ; if ( $ this -> hideIdSubDatatable === false && isset ( $ newRow [ 'metadata' ] [ 'idsubdatatable_in_db' ] ) ) { $ newRow [ 'columns' ] [ 'idsubdatatable' ] = $ newRow [ 'metadata' ] [ 'idsubdatatable_in_db' ] ; } unset ( $ newRow [ 'metadata' ] [ 'idsubdatatable_in_db' ] ) ; } if ( $ this -> hideIdSubDatatable !== false ) { unset ( $ newRow [ 'idsubdatatable' ] ) ; } $ array [ ] = $ newRow ; } return $ array ; }
docstring: Converts the given data table to an array
  
  @param DataTable $table
  @return array
docstring_tokens: Converts the given data table to an array