public function fromArray($array, $isList = false, $includeHeading = true)
    {
        $rows = array();
        if ($isList) {
            if ($includeHeading) {
                $rows[] = implode($this->formatRow(array_keys(reset($array))), $this->delimiter);
            }
            foreach ($array as $row) {
                $rows[] = implode($this->formatRow($row), $this->delimiter);
            }
        } else {
            if ($includeHeading) {
                $rows[] = implode($this->formatRow(array_keys($array)), $this->delimiter);
            }
            $rows[] = implode($this->formatRow($array), $this->delimiter);
        }

        return implode($rows, $this->lineTerminator) . $this->lineTerminator;
    }