From af7950b9d0e4d943990d2a44615d48096b5c5a8b Mon Sep 17 00:00:00 2001 From: joseph-d Date: Tue, 8 Nov 2016 09:46:27 +0000 Subject: [PATCH] Update Filter.php There is an addScopes function for extensibility but no way to remove scopes which are already there. --- modules/backend/widgets/Filter.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/backend/widgets/Filter.php b/modules/backend/widgets/Filter.php index 2a19a3e17..ae39fb375 100644 --- a/modules/backend/widgets/Filter.php +++ b/modules/backend/widgets/Filter.php @@ -477,6 +477,17 @@ class Filter extends WidgetBase $this->allScopes[$name] = $scopeObj; } } + + /** + * Programatically remove a scope, used for extensibility. + * @param string $scopeName Scope name + */ + public function removeScope($scopeName) + { + if (isset($this->allScopes[$scopeName])) { + unset($this->allScopes[$scopeName]); + } + } /** * Creates a filter scope object from name and configuration.