File tree Expand file tree Collapse file tree 5 files changed +23
-3
lines changed
PrestaShopBundle/Resources/config/services/core Expand file tree Collapse file tree 5 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -1130,7 +1130,7 @@ private static function getHookModuleFilter()
1130
1130
}
1131
1131
1132
1132
try {
1133
- $ hookModuleFilter = $ serviceContainer ->get (' prestashop.hook.module.filter ' );
1133
+ $ hookModuleFilter = $ serviceContainer ->get (HookModuleFilter::class );
1134
1134
} catch (Exception $ e ) {
1135
1135
return null ;
1136
1136
}
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ services:
26
26
public : false
27
27
tags : ['container.env_var_processor']
28
28
29
- prestashop.hook.module.filter :
30
- class : PrestaShop\PrestaShop\Core\Hook\HookModuleFilter
29
+ PrestaShop\PrestaShop\Core\Hook\HookModuleFilter :
31
30
arguments :
32
31
- !tagged core.hook_module_exec_filter
Original file line number Diff line number Diff line change 26
26
27
27
namespace PrestaShop \PrestaShop \Core \Hook ;
28
28
29
+ /**
30
+ * This service is responsible for filtering the list of modules for a given hook that is returned by
31
+ * the getHookModuleExecList method from Hook.php. It is called at the very end of getHookModuleExecList.
32
+ *
33
+ * How to use it to filter a list of modules for a hook:
34
+ *
35
+ * In your module, create a service which implements the HookModuleFilterInterface and give it
36
+ * the tag named core.hook_module_exec_filter. Then in your service, you can filter the list of modules
37
+ * in the filterHookModuleExecList method, according to your own logic.
38
+ *
39
+ * Your service will automatically be sent in this class's constructor, and be used to filter the list of modules.
40
+ */
29
41
class HookModuleFilter implements HookModuleFilterInterface
30
42
{
31
43
private $ hookModuleFilters ;
Original file line number Diff line number Diff line change 26
26
27
27
namespace PrestaShop \PrestaShop \Core \Hook ;
28
28
29
+ /**
30
+ * This interface must be implemented by all services that will be used by the HookModuleFilter service.
31
+ * See HookModuleFilter.php for more explanations.
32
+ */
29
33
interface HookModuleFilterInterface
30
34
{
31
35
public function filterHookModuleExecList (array $ modules , string $ hookName ): array ;
Original file line number Diff line number Diff line change 1
1
imports :
2
2
- { resource: ./circuit_breaker.yml }
3
+
4
+ services :
5
+ PrestaShop\PrestaShop\Core\Hook\HookModuleFilter :
6
+ arguments :
7
+ - !tagged core.hook_module_exec_filter
You can’t perform that action at this time.
0 commit comments