mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 21:13:57 +00:00
Allow to group exports
This commit is contained in:
@@ -231,6 +231,26 @@ class ExportManager
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all exports grouped in an array.
|
||||
*
|
||||
* @param bool $whereUserIsGranted
|
||||
* @return array where keys are the groups's name and value is an array of exports
|
||||
*/
|
||||
public function getExportsGrouped($whereUserIsGranted = true): array
|
||||
{
|
||||
$groups = [ '_' => [] ];
|
||||
foreach ($this->getExports($whereUserIsGranted) as $alias => $export) {
|
||||
if ($export instanceof GroupedExportInterface) {
|
||||
$groups[$export->getGroup()][$alias] = $export;
|
||||
} else {
|
||||
$groups['_'][$alias] = $export;
|
||||
}
|
||||
}
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an export by his alias
|
||||
*
|
||||
|
Reference in New Issue
Block a user