jablonka.czprosek.czf

freenet-router

Subversion Repositories:
[/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Framework/] [Libraries/] [ImportExport/] [Csv/] [CsvBuilder.php] - Rev 2

Compare with Previous - Blame - Download


<?php

namespace Phem\Libraries\ImportExport\Csv;

class CsvBuilder
{

    private $csv;
    private $insertLineBreaks;

    public function getCsv()
    {
        return $this->csv;
    }

    public function getInsertLineBreaks()
    {
        return $this->insertLineBreaks;
    }

    public function setInsertLineBreaks($insertLineBreaks)
    {
        $this->insertLineBreaks = $insertLineBreaks;
    }

    function __construct()
    {
        $this->csv = "";
        $this->insertLineBreaks = false;
    }

    public function appendValue($value)
    {
        if ($this->csv != "")
        {
            $this->csv .= ";";
            if ($this->insertLineBreaks)
                $this->csv .= "\n";
        }

        $this->csv .= $value;
    }
    
    public function appendEmptyValue()
    {
        $this->appendValue("");
    }
    
    public function appendEmptyValues($count)
    {
        for ($i = 0; $i < $count; $i ++)
        {
            $this->appendEmptyValue();
        }
    }

}

Powered by WebSVN 2.2.1