Private Member Functions |
| _writeLine ($pFileHandle=null, $pValues=null) |
| Write line to CSV file.
|
Detailed Description
Definition at line 57 of file CSV.php.
Constructor & Destructor Documentation
PHPExcel_Writer_CSV::__construct |
( |
PHPExcel |
$phpExcel | ) |
|
Create a new PHPExcel_Writer_CSV.
- Parameters
-
Definition at line 112 of file CSV.php.
{
$this->_phpExcel = $phpExcel;
$this->_delimiter = ',';
$this->_enclosure = '"';
$this->_lineEnding = PHP_EOL;
$this->_sheetIndex = 0;
}
Member Function Documentation
PHPExcel_Writer_CSV::_writeLine |
( |
|
$pFileHandle = null , |
|
|
|
$pValues = null |
|
) |
| |
|
private |
Write line to CSV file.
- Parameters
-
mixed | $pFileHandle | PHP filehandle |
array | $pValues | Array containing values in a row |
- Exceptions
-
Definition at line 268 of file CSV.php.
References $_delimiter, $_enclosure, and $_lineEnding.
Referenced by save().
{
if (!is_null($pFileHandle) && is_array($pValues)) {
$writeDelimiter = false;
$line = '';
foreach ($pValues as $element) {
$element = str_replace($this->_enclosure, $this->_enclosure . $this->_enclosure, $element);
if ($writeDelimiter) {
} else {
$writeDelimiter = true;
}
}
fwrite($pFileHandle, $line);
} else {
throw new Exception(
"Invalid parameters passed.");
}
}
PHPExcel_Writer_CSV::getDelimiter |
( |
| ) |
|
PHPExcel_Writer_CSV::getEnclosure |
( |
| ) |
|
PHPExcel_Writer_CSV::getLineEnding |
( |
| ) |
|
PHPExcel_Writer_CSV::getPreCalculateFormulas |
( |
| ) |
|
PHPExcel_Writer_CSV::getSheetIndex |
( |
| ) |
|
PHPExcel_Writer_CSV::getUseBOM |
( |
| ) |
|
Get whether BOM should be used.
- Returns
- boolean
Definition at line 226 of file CSV.php.
References $_useBOM.
PHPExcel_Writer_CSV::save |
( |
|
$pFilename = null | ) |
|
PHPExcel_Writer_CSV::setDelimiter |
( |
|
$pValue = ',' | ) |
|
Set delimiter.
- Parameters
-
string | $pValue | Delimiter, defaults to , |
- Returns
- PHPExcel_Writer_CSV
Definition at line 173 of file CSV.php.
{
$this->_delimiter = $pValue;
return $this;
}
PHPExcel_Writer_CSV::setEnclosure |
( |
|
$pValue = '"' | ) |
|
Set enclosure.
- Parameters
-
string | $pValue | Enclosure, defaults to " |
- Returns
- PHPExcel_Writer_CSV
Definition at line 193 of file CSV.php.
{
if ($pValue == '') {
$pValue = null;
}
$this->_enclosure = $pValue;
return $this;
}
PHPExcel_Writer_CSV::setLineEnding |
( |
|
$pValue = PHP_EOL | ) |
|
Set line ending.
- Parameters
-
string | $pValue | Line ending, defaults to OS line ending (PHP_EOL) |
- Returns
- PHPExcel_Writer_CSV
Definition at line 216 of file CSV.php.
{
$this->_lineEnding = $pValue;
return $this;
}
PHPExcel_Writer_CSV::setPreCalculateFormulas |
( |
|
$pValue = true | ) |
|
Set Pre-Calculate Formulas.
- Parameters
-
boolean | $pValue | Pre-Calculate Formulas? |
- Returns
- PHPExcel_Writer_CSV
Definition at line 316 of file CSV.php.
{
$this->_preCalculateFormulas = $pValue;
return $this;
}
PHPExcel_Writer_CSV::setSheetIndex |
( |
|
$pValue = 0 | ) |
|
PHPExcel_Writer_CSV::setUseBOM |
( |
|
$pValue = false | ) |
|
Set whether BOM should be used.
- Parameters
-
boolean | $pValue | Use UTF-8 byte-order mark? Defaults to false |
- Returns
- PHPExcel_Writer_CSV
Definition at line 236 of file CSV.php.
{
$this->_useBOM = $pValue;
return $this;
}
Field Documentation
PHPExcel_Writer_CSV::$_delimiter |
|
private |
PHPExcel_Writer_CSV::$_enclosure |
|
private |
PHPExcel_Writer_CSV::$_lineEnding |
|
private |
PHPExcel_Writer_CSV::$_phpExcel |
|
private |
PHPExcel_Writer_CSV::$_preCalculateFormulas = true |
|
private |
PHPExcel_Writer_CSV::$_sheetIndex |
|
private |
PHPExcel_Writer_CSV::$_useBOM = false |
|
private |
The documentation for this class was generated from the following file:
- Services/Excel/classes/PHPExcel/Writer/CSV.php