Partage d'export enregistré et génération asynchrone des exports

This commit is contained in:
2025-07-08 13:53:25 +00:00
parent c4cc0baa8e
commit 8bc16dadb0
447 changed files with 14134 additions and 3854 deletions

View File

@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MainBundle\Service\Regroupement;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Regroupment;
class CenterRegroupementResolver
{
/**
* Resolves and returns a unique list of centers by merging those from the provided
* groups and the additional centers while eliminating duplicates.
*
* @param list<Regroupment> $groups
* @param list<Center> $centers
*
* @return list<Center>
*/
public function resolveCenters(array $groups, array $centers = []): array
{
$centersByHash = [];
foreach ($groups as $group) {
foreach ($group->getCenters() as $center) {
$centersByHash[spl_object_hash($center)] = $center;
}
}
foreach ($centers as $center) {
$centersByHash[spl_object_hash($center)] = $center;
}
return array_values($centersByHash);
}
}