From 9897fb1ed76bcbc2a69a776b4d5652f108dbf7bc Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 8 Mar 2017 01:50:12 -0800 Subject: [PATCH] CRM-19813 - Civi::dispatcher() - Add lookup helper The `EventDispacherInterface` is widely-used across frameworks, and this makes it easier to lookup and autocomplete calls to the dispatcher. --- Civi.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Civi.php b/Civi.php index fe16326de7..ae5dc6f4b1 100644 --- a/Civi.php +++ b/Civi.php @@ -54,6 +54,15 @@ class Civi { return Civi\Core\Container::singleton(); } + /** + * Get the event dispatcher. + * + * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface + */ + public static function dispatcher() { + return Civi\Core\Container::singleton()->get('dispatcher'); + } + /** * @return \Civi\Core\Lock\LockManager */ -- 2.25.1