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;
    }