freenet-router |
Subversion Repositories: |
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();
}
}
}