summaryrefslogtreecommitdiff
path: root/app/Model/NotificationType.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-17 22:19:49 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-17 22:19:49 -0400
commit09da289c2fb18475f372bee24e885617da484e0b (patch)
tree95d1869ba3236ccdd9234d7909fc16c495c84d44 /app/Model/NotificationType.php
parent9283fb88d80cb355ff98364a9a57b657fc511d98 (diff)
Move slack, hipchat and jabber integrations to plugins
Diffstat (limited to 'app/Model/NotificationType.php')
-rw-r--r--app/Model/NotificationType.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/Model/NotificationType.php b/app/Model/NotificationType.php
index e05cc686..bc9c6fdc 100644
--- a/app/Model/NotificationType.php
+++ b/app/Model/NotificationType.php
@@ -108,4 +108,20 @@ abstract class NotificationType extends Base
{
return $this->hiddens;
}
+
+ /**
+ * Keep only loaded notification types
+ *
+ * @access public
+ * @param string[] $types
+ * @return array
+ */
+ public function filterTypes(array $types)
+ {
+ $classes = $this->classes;
+
+ return array_filter($types, function($type) use ($classes) {
+ return isset($classes[$type]);
+ });
+ }
}