Move enabled filters list to env #800
This commit is contained in:
parent
a10f58e425
commit
e1103cf108
2 changed files with 9 additions and 10 deletions
|
|
@ -16,6 +16,7 @@ parameters:
|
||||||
android_app_version: "%env(ANDROID_APP_VERSION)%"
|
android_app_version: "%env(ANDROID_APP_VERSION)%"
|
||||||
ios_app_version: "%env(IOS_APP_VERSION)%"
|
ios_app_version: "%env(IOS_APP_VERSION)%"
|
||||||
insurance_premiums_banner_url: "%env(INSURANCE_PREMIUMS_BANNER_URL)%"
|
insurance_premiums_banner_url: "%env(INSURANCE_PREMIUMS_BANNER_URL)%"
|
||||||
|
enabled_hub_filters: "%env(ENABLED_HUB_FILTERS)%"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# default configuration for services in *this* file
|
# default configuration for services in *this* file
|
||||||
|
|
|
||||||
|
|
@ -39,18 +39,16 @@ class HubSelector
|
||||||
$this->rt = $rt;
|
$this->rt = $rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: move this to env or something so we can enable and disable filters without code changes
|
|
||||||
protected function getActiveFilters(): array
|
protected function getActiveFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
$fnames = explode(",", $this->container->getParameter('enabled_hub_filters'));
|
||||||
'App\Service\HubFilter\Filters\DateAndTimeHubFilter',
|
$enabled_filters = [];
|
||||||
'App\Service\HubFilter\Filters\JoTypeHubFilter',
|
|
||||||
'App\Service\HubFilter\Filters\PaymentMethodHubFilter',
|
foreach ($fnames as $filter) {
|
||||||
'App\Service\HubFilter\Filters\RiderAvailabilityHubFilter',
|
$enabled_filters[] = 'App\\Service\\HubFilter\\Filters\\' . $filter;
|
||||||
'App\Service\HubFilter\Filters\InventoryHubFilter',
|
}
|
||||||
'App\Service\HubFilter\Filters\RoundRobinHubFilter',
|
|
||||||
'App\Service\HubFilter\Filters\MaxResultsHubFilter',
|
return $enabled_filters;
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function find(HubCriteria $criteria)
|
public function find(HubCriteria $criteria)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue