change deprecated CSV export code

This commit is contained in:
Daniel Seifert 2021-10-29 11:38:29 +02:00
parent e1502b274e
commit ea77239510
Signed by: DanielS
GPG Key ID: 8A7C4C6ED1915C6F

View File

@ -36,13 +36,12 @@ class Csv implements RendererInterface
$csv = $this->getCsv(); $csv = $this->getCsv();
$csv->insertOne( $fieldNames ); $csv->insertOne( $fieldNames );
$csv->insertAll( $rows ); $csv->insertAll( $rows );
return $csv->toString();
} catch (Exception $e) { } catch (Exception $e) {
/** @var RenderException $newException */ /** @var RenderException $newException */
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e ); $newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e );
throw $newException; throw $newException;
} }
return $csv->getContent();
} }
public function getFileExtension(): string public function getFileExtension(): string