mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 22:04:23 +00:00
check that the export::getResult return an array
if the export does not return an array, and UnexpectedValueException is thrown
This commit is contained in:
parent
63a1ab8d93
commit
baba8dbe5f
@ -418,6 +418,15 @@ class ExportManager
|
|||||||
|
|
||||||
$result = $export->getResult($query, $data[ExportType::EXPORT_KEY]);
|
$result = $export->getResult($query, $data[ExportType::EXPORT_KEY]);
|
||||||
|
|
||||||
|
if (!is_array($result)) {
|
||||||
|
throw new \UnexpectedValueException(
|
||||||
|
sprintf(
|
||||||
|
'The result of the export should be an array, %s given',
|
||||||
|
gettype($result)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/* @var $formatter Formatter\CSVFormatter */
|
/* @var $formatter Formatter\CSVFormatter */
|
||||||
$formatter = $this->getFormatter($this->getFormatterAlias($data));
|
$formatter = $this->getFormatter($this->getFormatterAlias($data));
|
||||||
$filters = array();
|
$filters = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user