mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix syntax
This commit is contained in:
parent
764d2cc87a
commit
ce34fea7e4
@ -87,8 +87,7 @@ class ScopePickerType extends AbstractType
|
||||
$items = $query->getQuery()->execute();
|
||||
|
||||
if (1 !== count($items)) {
|
||||
$builder->add(
|
||||
'scope', EntityType::class, [
|
||||
$builder->add('scope', EntityType::class, [
|
||||
'class' => Scope::class,
|
||||
'placeholder' => 'Choose the circle',
|
||||
'choice_label' => function (Scope $c) {
|
||||
@ -97,15 +96,12 @@ class ScopePickerType extends AbstractType
|
||||
'query_builder' => function () use ($options) {
|
||||
return $this->buildAccessibleScopeQuery($options['center'], $options['role']);
|
||||
},
|
||||
]
|
||||
);
|
||||
]);
|
||||
$builder->setDataMapper(new ScopePickerDataMapper());
|
||||
} else {
|
||||
$builder->add(
|
||||
'scope', HiddenType::class, [
|
||||
$builder->add('scope', HiddenType::class, [
|
||||
'data' => $items[0]->getId(),
|
||||
]
|
||||
);
|
||||
]);
|
||||
$builder->setDataMapper(new ScopePickerDataMapper($items[0]));
|
||||
}
|
||||
}
|
||||
@ -114,7 +110,7 @@ class ScopePickerType extends AbstractType
|
||||
{
|
||||
$view->vars = array_replace(
|
||||
$view->vars, [
|
||||
'hideLabel' => true,
|
||||
'hideLabel' => true,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user