summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hoffend <dh@dotlan.net>2015-02-18 11:26:08 (GMT)
committerDaniel Hoffend <dh@dotlan.net>2015-02-18 11:26:08 (GMT)
commit6282750bcc12760293514de517723e515df6dc59 (patch)
tree40d7d9c771f39734d8e007803dcc176512c02cbd
parent6c11665338354181ab1f4eb8db9166a0df9d28cd (diff)
downloadkolab-wap-6282750bcc12760293514de517723e515df6dc59.tar.gz
add method to check if a hook has been definedticket/4569
-rw-r--r--lib/kolab_hooks.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/kolab_hooks.php b/lib/kolab_hooks.php
index 1ffff31..9a91188 100644
--- a/lib/kolab_hooks.php
+++ b/lib/kolab_hooks.php
@@ -58,6 +58,20 @@ class kolab_hooks {
}
/**
+ * check if callbacks are registered for a given hook
+ *
+ * @static
+ * @param string $hook Hook name
+ * @return bool
+ */
+ public static function exists($hook)
+ {
+ return isset(self::$handlers[$hook])
+ && is_array(self::$handlers[$hook])
+ && count(self::$handlers[$hook]);
+ }
+
+ /**
* register a callback function for a certain hook
*
* @static