extract content rendering into separate method

This commit is contained in:
2021-12-21 13:27:19 +01:00
parent 69bf942608
commit e05278da19
2 changed files with 51 additions and 9 deletions

View File

@ -225,9 +225,7 @@ abstract class ExportBase implements QueryBase
*/
protected function executeExport(string $format, $path): string
{
[$rows, $fieldNames] = $this->getExportData($this->getQuery());
$content = $this->renderContent($rows, $fieldNames, $format);
$content = $this->getContent( $format );
/** @var $oFS d3filesystem */
$oFS = $this->getFileSystem();
@ -260,4 +258,21 @@ abstract class ExportBase implements QueryBase
{
return oxNew(d3filesystem::class);
}
/**
* @param string $format
*
* @return string
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
* @throws Exceptions\NoSuitableRendererException
*/
public function getContent( string $format ): string
{
[ $rows, $fieldNames ] = $this->getExportData( $this->getQuery() );
$content = $this->renderContent( $rows, $fieldNames, $format );
return $content;
}
}