Dataformat utility class.
More...
|
static | download_data (string $filename, string $dataformat, array $columns, Iterable $iterator, callable $callback=null) |
| Sends a formatted data file to the browser.
|
|
static | get_format_instance (string $dataformat) |
| Return an instance of a dataformat writer from given dataformat type.
|
|
static | write_data (string $filename, string $dataformat, array $columns, Iterable $iterator, callable $callback=null) |
| Writes a formatted data file with specified filename.
|
|
static | write_data_to_filearea (array $filerecord, string $dataformat, array $columns, Iterable $iterator, callable $callback=null) |
| Writes a formatted data file to file storage.
|
|
Dataformat utility class.
- Copyright
- 2020 Paul Holden paulh.nosp@m.@moo.nosp@m.dle.c.nosp@m.om
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ download_data()
static core\dataformat::download_data |
( |
string | $filename, |
|
|
string | $dataformat, |
|
|
array | $columns, |
|
|
Iterable | $iterator, |
|
|
callable | $callback = null ) |
|
static |
Sends a formatted data file to the browser.
- Parameters
-
string | $filename | |
string | $dataformat | |
array | $columns | |
Iterable | $iterator | |
callable | null | $callback | Optional callback method to apply to each record prior to writing, which accepts two parameters as such: function($record, bool $supportshtml) returning formatted record |
- Exceptions
-
◆ get_format_instance()
static core\dataformat::get_format_instance |
( |
string | $dataformat | ) |
|
|
static |
Return an instance of a dataformat writer from given dataformat type.
- Parameters
-
- Return values
-
- Exceptions
-
◆ write_data()
static core\dataformat::write_data |
( |
string | $filename, |
|
|
string | $dataformat, |
|
|
array | $columns, |
|
|
Iterable | $iterator, |
|
|
callable | $callback = null ) |
|
static |
Writes a formatted data file with specified filename.
- Parameters
-
string | $filename | |
string | $dataformat | |
array | $columns | |
Iterable | $iterator | |
callable | null | $callback | |
- Return values
-
string | Complete path to the file on disk |
◆ write_data_to_filearea()
static core\dataformat::write_data_to_filearea |
( |
array | $filerecord, |
|
|
string | $dataformat, |
|
|
array | $columns, |
|
|
Iterable | $iterator, |
|
|
callable | $callback = null ) |
|
static |
Writes a formatted data file to file storage.
- Parameters
-
array | $filerecord | File record for storage, 'filename' extension should be omitted as it's added by the dataformat |
string | $dataformat | |
array | $columns | |
Iterable | $iterator | Iterable set of records to write |
callable | null | $callback | Optional callback method to apply to each record prior to writing |
- Return values
-
The documentation for this class was generated from the following file: