original_string: public function flatRender($dataTable = null)
      {
          if (is_null($dataTable)) {
              $dataTable = $this->table;
          }
  
          if (is_array($dataTable)) {
              $flatArray = $dataTable;
              if (self::shouldWrapArrayBeforeRendering($flatArray)) {
                  $flatArray = array($flatArray);
              }
          } elseif ($dataTable instanceof DataTable\Map) {
              $flatArray = array();
              foreach ($dataTable->getDataTables() as $keyName => $table) {
                  $serializeSave = $this->serialize;
                  $this->serialize = false;
                  $flatArray[$keyName] = $this->flatRender($table);
                  $this->serialize = $serializeSave;
              }
          } elseif ($dataTable instanceof Simple) {
              $flatArray = $this->renderSimpleTable($dataTable);
  
              // if we return only one numeric value then we print out the result in a simple <result> tag
              // keep it simple!
              if (count($flatArray) == 1) {
                  $flatArray = current($flatArray);
              }
          } // A normal DataTable needs to be handled specifically
          else {
              $array = $this->renderTable($dataTable);
              $flatArray = $this->flattenArray($array);
          }
  
          if ($this->serialize) {
              $flatArray = serialize($flatArray);
          }
  
          return $flatArray;
      }
code: public function flatRender($dataTable = null)
      {
          if (is_null($dataTable)) {
              $dataTable = $this->table;
          }
  
          if (is_array($dataTable)) {
              $flatArray = $dataTable;
              if (self::shouldWrapArrayBeforeRendering($flatArray)) {
                  $flatArray = array($flatArray);
              }
          } elseif ($dataTable instanceof DataTable\Map) {
              $flatArray = array();
              foreach ($dataTable->getDataTables() as $keyName => $table) {
                  $serializeSave = $this->serialize;
                  $this->serialize = false;
                  $flatArray[$keyName] = $this->flatRender($table);
                  $this->serialize = $serializeSave;
              }
          } elseif ($dataTable instanceof Simple) {
              $flatArray = $this->renderSimpleTable($dataTable);
  
              // if we return only one numeric value then we print out the result in a simple <result> tag
              // keep it simple!
              if (count($flatArray) == 1) {
                  $flatArray = current($flatArray);
              }
          } // A normal DataTable needs to be handled specifically
          else {
              $array = $this->renderTable($dataTable);
              $flatArray = $this->flattenArray($array);
          }
  
          if ($this->serialize) {
              $flatArray = serialize($flatArray);
          }
  
          return $flatArray;
      }
code_tokens: public function flatRender ( $ dataTable = null ) { if ( is_null ( $ dataTable ) ) { $ dataTable = $ this -> table ; } if ( is_array ( $ dataTable ) ) { $ flatArray = $ dataTable ; if ( self :: shouldWrapArrayBeforeRendering ( $ flatArray ) ) { $ flatArray = array ( $ flatArray ) ; } } elseif ( $ dataTable instanceof DataTable \ Map ) { $ flatArray = array ( ) ; foreach ( $ dataTable -> getDataTables ( ) as $ keyName => $ table ) { $ serializeSave = $ this -> serialize ; $ this -> serialize = false ; $ flatArray [ $ keyName ] = $ this -> flatRender ( $ table ) ; $ this -> serialize = $ serializeSave ; } } elseif ( $ dataTable instanceof Simple ) { $ flatArray = $ this -> renderSimpleTable ( $ dataTable ) ; // if we return only one numeric value then we print out the result in a simple <result> tag // keep it simple! if ( count ( $ flatArray ) == 1 ) { $ flatArray = current ( $ flatArray ) ; } } // A normal DataTable needs to be handled specifically else { $ array = $ this -> renderTable ( $ dataTable ) ; $ flatArray = $ this -> flattenArray ( $ array ) ; } if ( $ this -> serialize ) { $ flatArray = serialize ( $ flatArray ) ; } return $ flatArray ; }
docstring: Produces a flat php array from the DataTable, putting "columns" and "metadata" on the same level.
  
  For example, when  a originalRender() would be
  array( 'columns' => array( 'col1_name' => value1, 'col2_name' => value2 ),
  'metadata' => array( 'metadata1_name' => value_metadata) )
  
  a flatRender() is
  array( 'col1_name' => value1,
  'col2_name' => value2,
  'metadata1_name' => value_metadata )
  
  @param null|DataTable|DataTable\Map|Simple $dataTable
  @return array  Php array representing the 'flat' version of the datatable
docstring_tokens: Produces a flat php array from the DataTable putting columns and metadata on the same level .