Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Attributes | List of all members
core\dataformat\base Class Reference

Base class for dataformat. More...

Inheritance diagram for core\dataformat\base:
core\dataformat\spout_base dataformat_html\writer dataformat_json\writer dataformat_pdf\writer dataformat_csv\writer dataformat_excel\writer dataformat_ods\writer

Public Member Functions

 close_output ()
 Write the end of the file.
 
 close_sheet ($columns)
 Write the end of the sheet containing the data. More...
 
 get_extension ()
 Get the file extension. More...
 
 send_http_headers ()
 Output file headers to initialise the download of the file.
 
 set_filename ($filename)
 Set download filename base. More...
 
 set_sheettitle ($title)
 Set the title of the worksheet inside a spreadsheet. More...
 
 start_output ()
 Write the start of the file.
 
 start_sheet ($columns)
 Write the start of the sheet we will be adding data to. More...
 
 write_record ($record, $rownum)
 Write a single record. More...
 

Protected Attributes

$extension $extension = ".txt"
 
$filename $filename = ''
 
$mimetype $mimetype = "text/plain"
 

Detailed Description

Base class for dataformat.

@subpackage dataformat

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ close_sheet()

core\dataformat\base::close_sheet (   $columns)

Write the end of the sheet containing the data.

Parameters
array$columns

Reimplemented in dataformat_json\writer, and dataformat_html\writer.

◆ get_extension()

core\dataformat\base::get_extension ( )

Get the file extension.

Return values
stringfile extension

◆ set_filename()

core\dataformat\base::set_filename (   $filename)

Set download filename base.

Parameters
string$filename

◆ set_sheettitle()

core\dataformat\base::set_sheettitle (   $title)

Set the title of the worksheet inside a spreadsheet.

For some formats this will be ignored.

Parameters
string$title

Reimplemented in core\dataformat\spout_base, dataformat_ods\writer, and dataformat_excel\writer.

◆ start_sheet()

core\dataformat\base::start_sheet (   $columns)

Write the start of the sheet we will be adding data to.

Parameters
array$columns

Reimplemented in core\dataformat\spout_base, dataformat_pdf\writer, dataformat_json\writer, and dataformat_html\writer.

◆ write_record()

core\dataformat\base::write_record (   $record,
  $rownum 
)
abstract

Write a single record.

Parameters
array$record
int$rownum

Reimplemented in core\dataformat\spout_base, dataformat_pdf\writer, dataformat_json\writer, and dataformat_html\writer.


The documentation for this class was generated from the following file: