MDL-68500 dataformat: allow instances to export to local file.
This commit is contained in:
@@ -72,6 +72,13 @@ class writer extends \core\dataformat\base {
|
||||
public function send_http_headers() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Start output to file, note that the actual writing of the file is done in {@see close_output_to_file()}
|
||||
*/
|
||||
public function start_output_to_file(): void {
|
||||
$this->start_output();
|
||||
}
|
||||
|
||||
public function start_output() {
|
||||
$this->pdf->AddPage('L');
|
||||
}
|
||||
@@ -126,6 +133,17 @@ class writer extends \core\dataformat\base {
|
||||
$this->pdf->Output($filename, 'D');
|
||||
}
|
||||
|
||||
/**
|
||||
* Write data to disk
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function close_output_to_file(): bool {
|
||||
$this->pdf->Output($this->filepath, 'F');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the heading row.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user