From: Tim Otten Date: Wed, 8 Mar 2017 09:50:12 +0000 (-0800) Subject: CRM-19813 - Civi::dispatcher() - Add lookup helper X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9897fb1ed76bcbc2a69a776b4d5652f108dbf7bc;p=civicrm-core.git 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. --- 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 */