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();
|
$items = $query->getQuery()->execute();
|
||||||
|
|
||||||
if (1 !== count($items)) {
|
if (1 !== count($items)) {
|
||||||
$builder->add(
|
$builder->add('scope', EntityType::class, [
|
||||||
'scope', EntityType::class, [
|
|
||||||
'class' => Scope::class,
|
'class' => Scope::class,
|
||||||
'placeholder' => 'Choose the circle',
|
'placeholder' => 'Choose the circle',
|
||||||
'choice_label' => function (Scope $c) {
|
'choice_label' => function (Scope $c) {
|
||||||
@ -97,15 +96,12 @@ class ScopePickerType extends AbstractType
|
|||||||
'query_builder' => function () use ($options) {
|
'query_builder' => function () use ($options) {
|
||||||
return $this->buildAccessibleScopeQuery($options['center'], $options['role']);
|
return $this->buildAccessibleScopeQuery($options['center'], $options['role']);
|
||||||
},
|
},
|
||||||
]
|
]);
|
||||||
);
|
|
||||||
$builder->setDataMapper(new ScopePickerDataMapper());
|
$builder->setDataMapper(new ScopePickerDataMapper());
|
||||||
} else {
|
} else {
|
||||||
$builder->add(
|
$builder->add('scope', HiddenType::class, [
|
||||||
'scope', HiddenType::class, [
|
|
||||||
'data' => $items[0]->getId(),
|
'data' => $items[0]->getId(),
|
||||||
]
|
]);
|
||||||
);
|
|
||||||
$builder->setDataMapper(new ScopePickerDataMapper($items[0]));
|
$builder->setDataMapper(new ScopePickerDataMapper($items[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -114,7 +110,7 @@ class ScopePickerType extends AbstractType
|
|||||||
{
|
{
|
||||||
$view->vars = array_replace(
|
$view->vars = array_replace(
|
||||||
$view->vars, [
|
$view->vars, [
|
||||||
'hideLabel' => true,
|
'hideLabel' => true,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user