mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
ACP EmergencyFilter: Do not loop on choices to show the picked one
This commit is contained in:
parent
a324121f01
commit
02330fcc75
@ -73,15 +73,11 @@ class EmergencyFilter implements FilterInterface
|
|||||||
|
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
foreach (self::CHOICES as $k => $v) {
|
|
||||||
if ($v === $data['accepted_emergency']) {
|
|
||||||
$choice = $k;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'Filtered by emergency: only %emergency%', [
|
'Filtered by emergency: only %emergency%', [
|
||||||
'%emergency%' => $this->translator->trans($choice),
|
'%emergency%' => $this->translator->trans(
|
||||||
|
$data['accepted_emergency'] ? 'is emergency' : 'is not emergency'
|
||||||
|
),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user