diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-07-31 11:28:33 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-07-31 11:28:33 -0400 |
commit | 92a5a0f8607e136e42e411a8b7aa9e948d3e3611 (patch) | |
tree | 4d950fb00b6058d2e8462a432edee44cab88804c /app/Core/Action | |
parent | 92ac133d23cf3447412a6e69f68f2bc2e64ce9cd (diff) |
Cleanup events and stuff before processing job in worker
Diffstat (limited to 'app/Core/Action')
-rw-r--r-- | app/Core/Action/ActionManager.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/Core/Action/ActionManager.php b/app/Core/Action/ActionManager.php index 1dfd820c..aec9ef02 100644 --- a/app/Core/Action/ActionManager.php +++ b/app/Core/Action/ActionManager.php @@ -139,4 +139,20 @@ class ActionManager extends Base return $this; } + + /** + * Remove all listeners for automated actions + * + * @access public + */ + public function removeEvents() + { + foreach ($this->dispatcher->getListeners() as $eventName => $listeners) { + foreach ($listeners as $listener) { + if (is_array($listener) && $listener[0] instanceof ActionBase) { + $this->dispatcher->removeListener($eventName, $listener); + } + } + } + } } |