$stream_filter_mode
$stream_filter_mode : integer
The stream filter mode (read or write).
A class to insert records into a CSV Document.
$document : \SplFileObject|\League\Csv\Stream
The CSV document.
createFromPath(\League\Csv\string $path, \League\Csv\string $open_mode = 'r+', resource|null $context = null) : static
Return a new instance from a file path.
| \League\Csv\string | $path | |
| \League\Csv\string | $open_mode | |
| resource|null | $context | the resource context |
| None found |
output(\League\Csv\string $filename = null) : integer
Outputs all data on the CSV file.
| \League\Csv\string | $filename |
Returns the number of characters read from the handle and passed through to the output.
| None found |
setDelimiter(\League\Csv\string $delimiter) : static
Sets the field delimiter.
| \League\Csv\string | $delimiter |
If the Csv control character is not one character only.
| None found |
setEnclosure(\League\Csv\string $enclosure) : static
Sets the field enclosure.
| \League\Csv\string | $enclosure |
If the Csv control character is not one character only.
| None found |
setEscape(\League\Csv\string $escape) : static
Sets the field escape character.
| \League\Csv\string | $escape |
If the Csv control character is not one character only.
| None found |
| None found |
| None found |
setOutputBOM(\League\Csv\string $str) : static
Sets the BOM sequence to prepend the CSV on output.
| \League\Csv\string | $str |
| None found |
addStreamFilter(\League\Csv\string $filtername, null|mixed $params = null) : static
append a stream filter.
| \League\Csv\string | $filtername | |
| null|mixed | $params |
If the stream filter API can not be used
| None found |
| None found |
getFlushThreshold() : integer|null
Get the flush threshold.
| None found |
insertAll(\Traversable|array $records)
Adds multiple records to the CSV document.
| \Traversable|array | $records |
| None found |
insertOne(array $record)
Adds a single record to a CSV document.
A record is an array that can contains scalar types values, NULL values or objects implementing the __toString method.
| array | $record |
If the record can not be inserted
| None found |
addFormatter(callable $formatter)
Adds a record formatter.
| callable | $formatter |
| None found |
addValidator(callable $validator, \League\Csv\string $validator_name)
Adds a record validator.
| callable | $validator | |
| \League\Csv\string | $validator_name |
| None found |
setNewline(\League\Csv\string $newline)
Sets the newline sequence.
| \League\Csv\string | $newline |
| None found |
setFlushThreshold(integer|null $threshold)
Set the flush threshold.
| integer|null | $threshold |
if the threshold is a integer lesser than 1
| None found |
__construct(\SplFileObject|\League\Csv\Stream $document)
New instance.
| \SplFileObject|\League\Csv\Stream | $document | The CSV Object instance |
| None found |
| None found |
sendHeaders(\League\Csv\string $filename)
Send the CSV headers.
Adapted from Symfony\Component\HttpFoundation\ResponseHeaderBag::makeDisposition
| \League\Csv\string | $filename |
if the submitted header is invalid according to RFC 6266
| None found |
addRecord(array $record) : integer|false
Adds a single record to a CSV Document using PHP algorithm.
| array | $record |
| None found |
addRFC4180CompliantRecord(array $record) : integer|false
Adds a single record to a CSV Document using RFC4180 algorithm.
| array | $record |
| None found |
formatRecord(array $record, callable $formatter)
Format a record.
The returned array must contain
| array | $record | |
| callable | $formatter |
| None found |
validateRecord(array $record)
Validate a record.
| array | $record |
If the validation failed
| None found |
| None found |