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;
    }
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;
    }
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 ; }
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
Produces a flat php array from the DataTable putting columns and metadata on the same level .