do not show filter on job or activity type if less than 2 possibilities

This commit is contained in:
2023-07-05 22:20:27 +02:00
parent 0e5f1b4ab9
commit c04fd66163
2 changed files with 43 additions and 16 deletions

View File

@@ -116,16 +116,31 @@ class FilterOrderHelper
->handleRequest($this->requestStack->getCurrentRequest());
}
public function hasCheckboxData(string $name): bool
{
return array_key_exists($name, $this->checkboxes);
}
public function getCheckboxData(string $name): array
{
return $this->getFormData()['checkboxes'][$name];
}
public function hasSingleCheckboxData(string $name): bool
{
return array_key_exists($name, $this->singleCheckbox);
}
public function getSingleCheckboxData(string $name): ?bool
{
return $this->getFormData()['single_checkboxes'][$name];
}
public function hasEntityChoice(string $name): bool
{
return array_key_exists($name, $this->entityChoices);
}
public function getEntityChoiceData($name): mixed
{
return $this->getFormData()['entity_choices'][$name];
@@ -144,6 +159,11 @@ class FilterOrderHelper
return $this->singleCheckbox;
}
public function hasDateRangeData(string $name): bool
{
return array_key_exists($name, $this->dateRanges);
}
/**
* @return array{to: ?DateTimeImmutable, from: ?DateTimeImmutable}
*/