mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
[CenterType] switch to hidden type with null value when no center is
reachable
This commit is contained in:
@@ -76,10 +76,7 @@ class CenterType extends AbstractType
|
||||
{
|
||||
$nbReachableCenters = count($this->reachableCenters);
|
||||
|
||||
if ($nbReachableCenters === 0) {
|
||||
throw new \RuntimeException("The user is not associated with "
|
||||
. "any center. Associate user with a center");
|
||||
} elseif ($nbReachableCenters === 1) {
|
||||
if ($nbReachableCenters <= 1) {
|
||||
return HiddenType::class;
|
||||
} else {
|
||||
return EntityType::class;
|
||||
|
Reference in New Issue
Block a user