Private Member Functions |
| _writeLine ($pFileHandle=null, $pValues=null) |
| Write line to CSV file.
|
Detailed Description
Definition at line 36 of file CSV.php.
Constructor & Destructor Documentation
PHPExcel_Writer_CSV::__construct |
( |
PHPExcel |
$phpExcel | ) |
|
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 246 of file CSV.php.
References $_delimiter, $_enclosure, and $_lineEnding.
Referenced by save().
{
if (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 204 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 151 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 171 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 194 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 294 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 214 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 = PHP_EOL |
|
private |
PHPExcel_Writer_CSV::$_phpExcel |
|
private |
PHPExcel_Writer_CSV::$_preCalculateFormulas = true |
|
private |
PHPExcel_Writer_CSV::$_sheetIndex = 0 |
|
private |
PHPExcel_Writer_CSV::$_useBOM = false |
|
private |
The documentation for this class was generated from the following file:
- Services/Excel/PHPExcel/1.7.6/Classes/PHPExcel/Writer/CSV.php