See Release Notes
Long Term Support Release
Differences Between: [Versions 39 and 401]
Class containing utility methods for dataformats
Copyright: | 2020 Paul Holden <paulh@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 170 lines (6 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
dataformat:: (4 methods):
get_format_instance()
download_data()
write_data()
write_data_to_filearea()
Class: dataformat - X-Ref
Dataformat utility classget_format_instance(string $dataformat) X-Ref |
Return an instance of a dataformat writer from given dataformat type param: string $dataformat return: dataformat\base |
download_data(string $filename, string $dataformat, array $columns, Iterable $iterator,callable $callback = null) X-Ref |
Sends a formatted data file to the browser param: string $filename param: string $dataformat param: array $columns param: Iterable $iterator param: callable|null $callback Optional callback method to apply to each record prior to writing, which accepts two |
write_data(string $filename, string $dataformat, array $columns, Iterable $iterator,callable $callback = null) X-Ref |
Writes a formatted data file with specified filename param: string $filename param: string $dataformat param: array $columns param: Iterable $iterator param: callable|null $callback return: string Complete path to the file on disk |
write_data_to_filearea(array $filerecord, string $dataformat, array $columns, Iterable $iterator,callable $callback = null) X-Ref |
Writes a formatted data file to file storage param: array $filerecord File record for storage, 'filename' extension should be omitted as it's added by the dataformat param: string $dataformat param: array $columns param: Iterable $iterator Iterable set of records to write param: callable|null $callback Optional callback method to apply to each record prior to writing return: stored_file |