Get the csv file as a string.

@return string
341243
public function asString()
    {
        $tmp = new \SplTempFileObject;

        foreach ($this->data as $row) {
            $tmp->fputcsv($row, $this->delimiter);

            if ($this->lineEnding !== "\n") {
                $tmp->fseek(-1, \SEEK_CUR);
                $tmp->fwrite($this->lineEnding);
            }
        }

        # Find out how much data we have written
        $length = $tmp->ftell();
        if ($length < 1) {
            return "";
        }

        # Reset the internal pointer and return all the data we have written
        $tmp->fseek(0);
        return $tmp->fread($length);
    }
147520
public function toString()
    {
        $request = sprintf('%s %s HTTP/%s', $this->getMethod(), (string) $this->getUrl(), $this->getVersion());

        $str = trim($request) . "\r\n";
        $str .= $this->getHeaders();
        $str .= "\r\n";
        $str .= $this->getContent();
        return $str;
    }
1262828
protected function makeCsvFileTitle()
    {
        return vsprintf('%s %s as of %s at %s.csv', [
            Decoy::site(),
            $this->title(),
            Carbon::now()->format('n.j.y'),
            Carbon::now()->format('g:i A'),
        ]);
    }
1158705
public function toFilePath(): string
    {
        if (!strlen((string)$this->partition)) {
            return str_replace(':', '/', $this->id);
        }

        $hash = md5($this->partition);
        return trim(sprintf(
            '%s/%s/%s/%s/%s',
            $this->topic,
            substr($hash, 0, 2),
            substr($hash, 2, 2),
            $this->partition,
            $this->subPartition
        ), '/');
    }
522208
public function toString()
    {
        $stringAttr = array();

        foreach ($this->attributes as $name => $value) {
            $stringAttr[] = $name.'='.$this->escape($value);
        }

        return implode(',', $stringAttr);
    }
637559
protected function FetchCSVFile()
    {
        $bFileWritten = false;

        $sCSVData = file_get_contents($this->fieldRatingUrl);

        if (!empty($sCSVData)) {
            if (false !== file_put_contents($this->sCsvFilePath, $sCSVData)) {
                $bFileWritten = true;
            } else {
                $this->WriteLogEntry('Could not read CSV from '.$this->fieldRatingUrl, __LINE__);
            }
        } else {
            $this->WriteLogEntry($this->sCsvFilePath.' could not be written.', __LINE__);
        }

        return $bFileWritten;
    }
920853
public function str()
	{
		$str = '';
		foreach ($this->attributes as $name => $value) {
			$str .= $this->getAttribStr($name);
		}
		return $str;
	}
25293
public function toString()
    {
        $matchToString = function ($key, $value) {
            return ' "' . $key . '" is "' . $value . '"';
        };

        $matchesToString = function ($matches) use ($matchToString) {
            $matchesAsString = implode(' and ', array_map(
                $matchToString,
                array_keys($matches),
                array_values($matches)
            ));

            return '(' . $matchesAsString . ')';
        };

        $allMatchesAsString = implode(
            "\n or ",
            array_map($matchesToString, $this->matches)
        );


        return $this->getStubForToString() . $allMatchesAsString;
    }
594727
public function toString() {
        $description = $this->getDescription();
        if($description == '') {
            $description = $this->getName();
        }
        $buffer = '	/**
	 * ' . $description . "\n";
        if($this->isPrimary()) {
            $buffer .= '	 * @Primary' . "\n";
        }
        if($this->isAutoIncrementing()) {
            $buffer .= '	 * @Identity' . "\n";
        }
        $buffer .= '	 * @Column(type="' . $this->getType() . '"'
            . (!is_null($this->getLength()) ? ', length=' . $this->getLength() : '')
            . ', nullable=' . ($this->isNullable() ? 'true' : 'false') . ')' . "\n";
        $buffer .= '	 */
	' . $this->getAccess() . ' $' . $this->getName() . ';
';
        return $buffer;
    }
150730
function toString(){
		if(isset($this->_String)){ return parent::toString(); }
		return Files::GetFileContent($this->_Filename);
	}
771065
private function read()
    {
        $out = fgetcsv($this->handle, null, $this->delimiter, $this->enclosure);

        if (!is_array($out)) {
            return $out;
        }

        if ($this->encodingFrom !== null && $this->encodingTo !== null) {
            foreach ($out as $k => $v) {
                $out[$k] = iconv($this->encodingFrom, $this->encodingTo, $v);
            }
        }

        return $out;
    }
1111062
public function toString()
    {
        $string = '';
        $methods = $this->getIterator();
        foreach ($methods as $method) {
            $string .= $method->toString();
        }

        return $string;
    }
83221
public function toString()
    {
        $result = "<app-data>\n";
        foreach ($this->dbList as $dbList) {
            $result .= $dbList->toString();
        }
        if ($this->dbList) {
            $result .= "\n";
        }
        $result .= "</app-data>";

        return $result;
    }
1090670
public function getTableAsString()
    {
        $lines = array();
        for ($i = 0; $i < count($this->getRows()); $i++) {
            $lines[] = $this->getRowAsString($i);
        }

        return implode("\n", $lines);
    }
440108
protected function fetchCSVRow()
    {
        if (!$this->fileHandle) {
            $this->openFile();
        }

        if (!$this->headerRow) {
            $this->fetchCSVHeader();
        }

        $this->rowNum++;

        $srcRow = fgetcsv(
            $this->fileHandle,
            0,
            $this->delimiter,
            $this->enclosure
        );

        if ($srcRow) {
            $row = array();

            foreach ($srcRow as $i => $value) {
                // Allow escaping of quotes and commas in the data
                $value = str_replace(
                    array('\\' . $this->enclosure,'\\' . $this->delimiter),
                    array($this->enclosure, $this->delimiter),
                    $value
                );
                // Trim leading tab
                // [SS-2017-007] Ensure all cells with leading [@=+] have a leading tab
                $value = ltrim($value, "\t");
                if (array_key_exists($i, $this->headerRow)) {
                    if ($this->headerRow[$i]) {
                        $row[$this->headerRow[$i]] = $value;
                    }
                } else {
                    user_error("No heading for column $i on row $this->rowNum", E_USER_WARNING);
                }
            }

            $this->currentRow = $row;
        } else {
            $this->closeFile();
        }

        return $this->currentRow;
    }
611075
public function getHeaderString()
    {
        $string = '';
        foreach ($this->headers as $name => $values) {
            foreach ($values as $value) {
                $string .= $name . ': ' . $value . "\r\n";
            }
        }
        return $string;
    }
1302168
public function toString()
    {
        if (empty($this->stringRepresentation)) {
            $this->stringRepresentation = sprintf('%s%s_%s', static::MESSAGE_TO_STRING_PREFIX, $this->getSourceId(), $this->getResourceId());
        }
        return $this->stringRepresentation;
    }