Piwik\DataTable\Row::__toString PHP Method

__toString() public method

Applies a basic rendering to the Row and returns the output.
public __toString ( ) : string
return string describing the row. Example: "- 1 ['label' => 'piwik', 'nb_uniq_visitors' => 1685, 'nb_visits' => 1861] [] [idsubtable = 1375]"
    public function __toString()
    {
        $columns = array();
        foreach ($this->getColumns() as $column => $value) {
            if (is_string($value)) {
                $value = "'{$value}'";
            } elseif (is_array($value)) {
                $value = var_export($value, true);
            }
            $columns[] = "'{$column}' => {$value}";
        }
        $columns = implode(", ", $columns);
        $metadata = array();
        foreach ($this->getMetadata() as $name => $value) {
            if (is_string($value)) {
                $value = "'{$value}'";
            } elseif (is_array($value)) {
                $value = var_export($value, true);
            }
            $metadata[] = "'{$name}' => {$value}";
        }
        $metadata = implode(", ", $metadata);
        $output = "# [" . $columns . "] [" . $metadata . "] [idsubtable = " . $this->getIdSubDataTable() . "]<br />\n";
        return $output;
    }